After clicking the list items, I would like EquipmentLabel to bind to the name of the Item object. Item is a class. Now when I click on a list item, the label text disappears completely
How I can bind a label to variable?
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK
Hi,
Why I am starting to see this error:
**You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again
**
when I try to archive an Android package?
I contacted Google and they told me it's nothing to do with the certificate..
Thanks,
Jassim
Execute tapped gesture programmatically ?
Is it possible to execute tapped gesture using the code without user really tapping? I need to do it in OnAppearing.
Why does toolbar duplicate and not hide for iOS using Xamarin.Forms?
I'm attempting to apply a toolbar to android and iOs app via Xamarin.Forms. I understand that in iOS, the secondary order doesn't work the way it does for android app but my expectation is at least when toolbar items are defined, they should display horizontally. But the issue is that the toolbar is duplicated:
Here is how it displays in Android:
I configured toolbar via XAML:
Access Denied when calling Directory.GetFiles on Android
In the manifest, I've specified
Using the same app:
I tried it first on a Samsung A50, have not been able to make this work.
Tried it again on an ASUS phone, it worked but only after going to Settings->App->Permissions and manually add Storage Permission, which I had to do on both phones.
Is there not a manifest entry which will set this automatically?
I could attribute the access denied to being a Samsung issue but I've downloaded other non-samsung apps, which are minimally able to read files from a folder and I don't have to explicitly set the storage setting for it.
Why is my SkiaSharp canvas not drawing on Android ?
Hello,
I am using SkiaSharp canvas (SKCanvas) to draw a SVG path on my Xamarin.Forms app.
I have something like that :
<?xml version="1.0" encoding="UTF-8"?> <ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:skia="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms" mc:Ignorable="d" x:Class="MyApp.Controls.CircleTimer"> <ContentView.Content> <Grid> <skia:SKCanvasView PaintSurface="SKCanvasView_PaintSurface" x:Name="SKCanvas"/> </Grid> </ContentView.Content> </ContentView>
And in my code-behind :
private void SKCanvasView_PaintSurface(object sender, SKPaintSurfaceEventArgs e) { string svg = $"MY COMPLEXE SVG..."; var path = SKPath.ParseSvgPathData(svg); var canvas = e.Surface.Canvas; canvas.Clear(); var paint = new SKPaint { Style = SKPaintStyle.Fill, Color = CIRCLE_COLOR }; canvas.DrawPath(path, paint); }
My app has a iOS, Android and UWP projects, even if I cannot test on iOS now.
On my UWP app, my circle render correctly
But on Android, the PaintSurface
event is never raised, so my canvas never draw.
There is no difference between these 2 platforms, nothing in the Xamarin.UWP or Xamarin.Android projects ...
How can I find a way to render this on Android ?
Thanks
Return to Page - following Xamarin Essentials Map OpenAsync()
I am working with Xamarin.Essentials.Map.OpenAsync() for a Xamarin Forms application;
All is OK - opens installed application to specific location, etc;
`var location = new Location(checkLat, checkLong);` ` var options = new MapLaunchOptions { NavigationMode = NavigationMode.Driving, Name = checkNameFM };` `await Xamarin.Essentials.Map.OpenAsync(location, options);`
I am writing to ask how best to handle (or intercept) returning to application page from Xamarin.Essentials.Map.OpenAsync(location, options);
Thanks in advance for insight, guidance;
Xamarin Experiment - SetFlags - AppTheme_Experimental
I have decided to update a Xamarin Forms app to XF 4.8. I have written some AppThemeColor for the handling of dark mode. Everything worked fine in XF 4.6. Upgrading to XF 4.8 has produced an error now where I am getting the error that AppThemeColor does not exist and wondering if I have referenced all of my assemblies. Previously, there had been a problem with the the XF 4.7 and needing to opt into the experimental theme features. Ok, so I go into my App.xaml.cs class and into the App initializor and call:
Device.SetFlags(new string[] {"AppTheme_Experimental"});
No love. Ok, so I try this in the iOS and Android projects to set the flags programmatically in the FinishedLaunching and the OnCreate methods. Still no love. I continue to get the errors.
Personally, I would think that I need to do something in a project options setting to get the compiler to pick this up, but I don't see anything.
Question: How do I turn on the AppThemeColor so that it will compile properly?
TIA, Wally
Looking for Almicantarat internal testers on google play
Hi,
after several years of coding, I am ready to release my Xamarin.Forms app, Almicantarat, on Google play as a first step.
Almicantarat helps sailors to find their position at sea by shooting the stars with a sextant.
Because my app will not be free, it seems I cannot release a free open alpha or beta test. The only way to make it free is to make a internal test.
It would be great that people from the xamarin forum were testing my app to give an opinion on the way I have used Xamarin.
If you wish to test my app, I would appreciate that you send me your email adress by private post to add it to the list of internal testers on google play.
You can see a demo of Almicantarat on youtube:
Stylise the page title text
Hi
Xamarin Forms 4.8. VS 2019 16.7.0.
I am trying to stylise the page title text such as font size and alignment using NavigationPage.TitleView. I am using below code for my page but its not working. This is the result when page is running;
What am I missing?
Thanks
Regards
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Title="This text shows" Shell.TabBarIsVisible="False" x:Class="StaffApp.Views.MainPage"> <NavigationPage.TitleView> <Label Text="This text does not show" FontSize="15" FontAttributes="None" HorizontalTextAlignment="Center" /> </NavigationPage.TitleView> <ContentPage.Content> <StackLayout> <Label Text="Welcome to App Home Page" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /> </StackLayout> </ContentPage.Content> </ContentPage>
How to Set FLAG_ACTIVITY_NEW_TASK in Android MainActivity
Hi All,
When try to call Activity from outside of MainActivity, then i got this error. IS
Android.Util.AndroidRuntimeException: 'Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?'
I couldn't set FLAG_ACTIVITY_NEW_TASK under Intent.
Thanks in Advance.:)
Sending Multiple Paramters to EventToCommandBehavior
I have followed Xamarin documentation (and sample code) for EventToCommandBehavior and it works well. However, I am not sure how to send Multiple Parameters to ValueConverter. I used below syntax but instead of SelectedItem, I got the whole ViewModel, though I got view (ListView) from Converter Parameter.
<ListView.Behaviors> <behaviors:EventToCommandBehavior EventName="ItemSelected" Command="{Binding ItemSelectedCommand}" CommandParameter="{Binding Path=., Converter={StaticResource eventToSelectedItem}, ConverterParameter={Reference MyList}}"/> </ListView.Behaviors>
So basically I have to two questions.
- How can I send the Selected List item plus View (or any parameter) in above code syntax.
- How can I send Multiple Parameters in EventToCommandBehavior, like you can do in Value Converter.
jamesmontemagno / GeolocatorPlugin commercial use
Hi,
Does anyone have any information on what specific service provider does the Geolocator plugin use for getting address information from GPS-coordinates? Can't seem to find any details about that.
https://github.com/jamesmontemagno/GeolocatorPlugin
Cheers,
// TDMR87
Binding listview to datasource
Hi
I have a service as below with a method listAsync that gets data from a remote API. How do I bind a listview to data provided by listAsync?
Thanks
Regards
public class UpcomingJobService { //... async Task<List<UpcomingJob>> listAsync(string apiToken) { } }
Lifetime of ViewModel
Hi,
What is the lifetime of a viewmodel?
For example, can I use a ViewModel variable called isSignedIn and it will be stored even when the app is closed or killed?
or I should still use the SecureStorage / Preference for that?
Thanks,
Jassim
How to delete an image from a file picture? Xamarin forms
I've tried this but it doesnt work
File.Delete(@storage/emulated/0/Android/data/com.companyname.micerveza/files/Pictures/Cervezas/7796989007620_2.jpg);
How to delete an image from a file pictures on xamarin forms?
I've tried this, but it doesnt work
Not seeing any ios simulator in any of my Xamarin forms project
From yesterday suddenly I am not seeing any ios simulator in any of my Xamarin forms project. Am seeing only the "Generic simulator" option. When I click on that, a drop-down appears with a message "Lower the Deployment target to see older simulators or check your apple sdk path".
I checked my Info.Plist file, the minimum system version is 9.0.
Xcode: 11.6 (16141)
Instruments: 11.6 (64535.76)
SDKs:
iOS:
13.6: (17G64)
iOS Simulator:
13.6: (17G64)
I am using Visual Studio Community 2019 for Mac (Version 8.7.3 (build 13))
I even tried by reinstalling Visual studio
Content view visibility handling from Content page's view model
I am adding like this content view which is having its own view model.I want to handle its visibility from view model of content page.
<ContentPage> <local:ContentView1 IsVisible="{Binding IsContentViewVisible}"/> </ContentPage>
Here is page's view model binding for content view's hiding and showing public bool IsContentViewVisible{get;set;} and then i am using it by giving true or false. I am using Fody so there is no need of INotifyPropertyChanged I assume.
Unable to download files when target set to Android 10 API level 29 in xamarin Android visual studio
Working with xamarin forms and changed Target Android Version to Android 10.0 API level 29. I am downloading pdf ZIP files from server and saving in External Storage. So this works fine till Android 9. but in Android 10 devices unable to download content. i added android:requestLegacyExternalStorage="true" in manifest.xml . now i am able to create directory with package name in external storage. so i gave this path to download manager. when download manager starts downloading it shown java.lang.securityException. and message is unsupported path.
below is my code:
// to get path
public string StoragePath()
{
return Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/." + Assets.AppConst.ApplicationId + "/"; } // downloadservice class
string extension = FetchFileExtension(downloadPath.ContentUrl.ContentType);
string path = Path.Combine(DependencyService.Get<Interfaces.IPath>().StoragePath(), productId + extension);
IDownloadManager downloadManager = CrossDownloadManager.Current;
downloadManager.PathNameForDownloadedFile = new Func<IDownloadFile, string>(file =>
{
return path;
});
FetchLaunchData(productId);
IDownloadFile downloadFile = downloadManager.CreateDownloadFile(downloadPath.ContentUrl.Offline);
_activeDownloads[productId] = downloadFile;
downloadFile.PropertyChanged += PropertyChangedEventHandler;
downStartTime = DateTimeOffset.Now.ToUnixTimeMilliseconds();
downloadManager.Start(downloadFile); ------at this last line am getting exception