xamarin.forms

Adding questions and answers to Pin Xamarin.forms

社会主义新天地 提交于 2020-05-09 15:57:55
问题 Is there any way to make a popup with a few questions + a few answers to choose from after pressing the added pin on the map? How to do that? What I mean most is how to combine the popup with the pin (in xamarin.forms) I apologize for my weak language My pin code for adding pins: private async void OnButton(object sender, EventArgs e) { Pin pin = new Pin { Label = "Nazwa", Address = "adres", Type = PinType.SavedPin, Position = new Position(Convert.ToDouble(szerokosc.Text), Convert.ToDouble

How can I communicate in my app with ViewModel?

女生的网名这么多〃 提交于 2020-05-09 15:47:51
问题 How communicate in my app with my ViewModel? I have this code, sleep and resume of my app protected override void OnSleep() { MessagingCenter.Send<App, string>(this, "gotosleep", "savedata"); } in my ViewModel I subscribe to the message, but it does not work. My message is never displayed. public MyViewModel() { MessagingCenter.Subscribe<App, string>(this, "gotosleep", async (obj, item) => { Console.WriteLine("HERE"); }); } 回答1: You should use the MyViewModel in ContentPage , then Subscribe

Skipped 675 frames! The application may be doing too much work on its main thread. How to make app run process in background without freezing the UI?

本小妞迷上赌 提交于 2020-05-09 10:32:08
问题 I have an news aggregator and in debug i have the following: Skipped 675 frames! The application may be doing too much work on its main thread. I am loading only from 12 sites. Is there a way to to do all this loading in background without the whole app freezing? EDIT: Method to get one news public async static Task<NewsContent> oneNews(string category,string site) { if(sites.Count==0) addElements(); GetNews gn = new GetNews(site,false); Random rn = new Random(); var s = await gn.news(rn.Next

Skipped 675 frames! The application may be doing too much work on its main thread. How to make app run process in background without freezing the UI?

情到浓时终转凉″ 提交于 2020-05-09 10:30:54
问题 I have an news aggregator and in debug i have the following: Skipped 675 frames! The application may be doing too much work on its main thread. I am loading only from 12 sites. Is there a way to to do all this loading in background without the whole app freezing? EDIT: Method to get one news public async static Task<NewsContent> oneNews(string category,string site) { if(sites.Count==0) addElements(); GetNews gn = new GetNews(site,false); Random rn = new Random(); var s = await gn.news(rn.Next

Create dashed line in ListView Xamarin Forms

对着背影说爱祢 提交于 2020-05-09 10:27:31
问题 How can I create a dashed line to use as a separator for my list view? Example: 回答1: You could do this in custom renderer of listview. MyListViewRenderer.cs: public class MyListViewRenderer : ListViewRenderer { Context ctx; public MyListViewRenderer(Context context) : base(context) { ctx = context; } protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e) { base.OnElementChanged(e); if (Control != null) { //var listView = Control as Android.Widget.ListView;

How do I build an iPhone Xamarin App without a Mac?

半世苍凉 提交于 2020-05-09 10:25:57
问题 I'm developing xamarin forms apps. I can generate the APKs and run it on my android devices. But how can I do the same for iPhones without having a mac? Is there a way to build my apps on app center or azure devops where it generates the ipa files? Thanks 回答1: Here is guidance about how to build Xamarin apps for Android and iOS in azure-devops: Build Xamarin apps azure-devops Here is document about how to build Xamarin iOS app in AppCenter: Building Xamarin apps for iOS in AppCenter If you

Get ListView from Button Command xamarin.forms MVVM

怎甘沉沦 提交于 2020-05-09 07:04:24
问题 I have an issue on my ListView in my xamarin.forms application where I use MVVM pattern. I hope you could help me. Here is my xaml: <ListView x:Name="MissingVolumeListView" ItemsSource="{Binding Volumes}" SelectedItem ="{Binding Id}" > <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid x:Name="Item"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="40"/> </Grid.ColumnDefinitions> <Label Text="{Binding Name}" Style="{StaticResource UsualLabelTemplate}"/>

Xamarin Forms “Bundle assemblies into native code” and ofbuscation

北战南征 提交于 2020-05-08 04:10:09
问题 I created Android app with Xamarin Forms. For release I use option "Bundle assemblies into native code". My apk have size - 17 Mb, without this option 33 Mb. Do I need to use obfuscation for my libraries or my code is protected? I searched a lot - but I did not find an exact answer. 回答1: Bundle Assemblies into Native Code means: When this option is enabled, assemblies are bundled into a native shared library. This option keeps your code safe; it protects managed assemblies by embedding them

xamarin forms get pdf path

拜拜、爱过 提交于 2020-04-30 16:36:15
问题 I've successfully read a pdf from the project and displayed in a WebView. What I want to do is to get the pdf file path from my project and check if it exists to display it, and if not, to give it another URI to open with. Anyone knows how I can get the path of the pdf and it works for both Android and iOS. Here is my C# code: string internalstorageurl = string.Format("file:///android_asset/Content/{0}", WebUtility.UrlEncode("Conctionprofile.pdf")); public pdfviewer () { InitializeComponent (

xamarin forms get pdf path

会有一股神秘感。 提交于 2020-04-30 16:35:59
问题 I've successfully read a pdf from the project and displayed in a WebView. What I want to do is to get the pdf file path from my project and check if it exists to display it, and if not, to give it another URI to open with. Anyone knows how I can get the path of the pdf and it works for both Android and iOS. Here is my C# code: string internalstorageurl = string.Format("file:///android_asset/Content/{0}", WebUtility.UrlEncode("Conctionprofile.pdf")); public pdfviewer () { InitializeComponent (