xamarin.forms

Xamarin UWP app size is too big? how to reduce?

て烟熏妆下的殇ゞ 提交于 2021-01-28 08:37:42
问题 I have built a xamarin forms app and android size 17mb using proguard, full linking. However UWP size is 76 mb. I am already using configuration as in the screenshot below. I am support x86, x64 and arm architectures on both platforms. in android i create separate packages per abi. thats why 17mb is each abi size. but I couldnt find a similar option in UWP. it is size of bundle. is there a way to provide 3 installers? Beside that why is the size too large and how can i optimize it further? PS

How to present a modal Login screen using ViewModel First navigation in Xamarin

懵懂的女人 提交于 2021-01-28 08:16:20
问题 So I am using the FreshMVVM Xamarin.Forms library so I can do ViewModel-first navigation in xamarin. My research tells me that this is a highly recommended practice, yet there seem to be not a whole lot of tutorials for this. What I am trying to achieve is a login page that pops up as a modal once the user opens the app if they are not signed in. I have modified the demo project slightly by adding the modal display button and associated Command from the ViewModel to the first page, however, I

Xamarin forms - Passing data between pages & views

邮差的信 提交于 2021-01-28 07:31:46
问题 I have a xamarin forms app. There are 2 classes with data, one of the pages is filling the data. The problem is: I'm creating new view, that should use data from both classes. The only way i'm familiar with is to set a class as a bindingContext to pass data between pages, and it's working fine with ONE class, because apparently there couldn't be 2 bindingContext at the same time. EXAMPLE: 1st class (all the classes are filled on the previous page. just accept that they are filled) public

How to check if the file exist in xamarin forms

你说的曾经没有我的故事 提交于 2021-01-28 06:50:57
问题 I want to check if the file inside my device exist. When the variable crphoto1 is empty or the file does not exist the " Photo1 " json should be {"Photo1", ""} JObject ph1json = string.IsNullOrEmpty(crphoto1) ? new JObject { {"ContactID", crcontactID}, {"Photo1", ""} } : new JObject { {"ContactID", crcontactID}, {"Photo1", File.ReadAllBytes(crphoto1)} }; 回答1: If you are just looking for how to check if file exist you can use using System.IO; string fileName = Path.Combine(Environment

Unable to load file or assembly 'Mono.Cecil.Pdb' VS17

巧了我就是萌 提交于 2021-01-28 06:36:34
问题 I'm developing a xamarin.forms project using VS17. I have a build faild with this error: 1>System.IO.FileLoadException: Unable to load file or assembly 'Mono.Cecil.Pdb, Version = 0.10.0.0, PublicKeyToken = 50cebf1cceb9d05e' or one of its dependencies. Invalid parameter (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) 1>File name: 'Mono.Cecil.Pdb, Version=0.10.0.0, PublicKeyToken=50cebf1cceb9d05e' ---> System.ArgumentException: Paramètre incorrect. (Exception de HRESULT : 0x80070057 (E

Store & retrieve array in SQLite database in Xamarin

懵懂的女人 提交于 2021-01-28 06:20:25
问题 I wanted to store and retrieve an array in a SQLite database in my Xamarin App. I'm following this Xamarin Tutorial on SQLite. These values will be then show in Picker . I used Models earlier to store array and then get the values and list it in Picker , it was working fine, but the only problem was that it wasn't stored permanently (by closing app array list get empty). Banks using SQLite; namespace Mobile.App { public class Banks { [PrimaryKey, AutoIncrement] public int ID { get; set; }

Xamarin.Forms Android VS2017 debug not showing XAML changes

落花浮王杯 提交于 2021-01-28 06:08:54
问题 In Visual Studio 2017, I start a brand new Xamarin.Forms solution, PCL and Blank App template. Here is what the MainPage.xaml content looks like: <Label Text="Welcome to Xamarin Forms!" VerticalOptions="Center" HorizontalOptions="Center" /> Using the Visual Studio Android emulator, I start a debug session, to confirm its working, and then close it. Then I make a small change the MainPage.xaml file, for example: <StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"

Xamarin.iOS linker and reflection issue

独自空忆成欢 提交于 2021-01-28 05:14:11
问题 In my Xamarin.iOS project I need to reduce the assembly size (Apple's requirement for AppStore applications), and I need to turn on linker, setting the linker behavior either to "Link Framework SDKs only" or "Link All". When I've selected "Link Framework SDKs only" in Linker behavior I get the compilation error upon building the project: Can't resolve the reference 'System.Void System.Data.SqlClient.SqlCommandBuilder::DeriveParameters(System.Data.SqlClient.SqlCommand)', referenced from the

Request hangs after RefreshToken expires JsonHttpClient ServiceStack

若如初见. 提交于 2021-01-28 04:07:25
问题 I'm using ServiceStack JsonHttpClient client (5.9.0) in my Xamarin.Forms mobile app. Client is set like this: client = new JsonHttpClient(App.BaseEndpoint) { RefreshToken = RefreshToken, }; var httpClient = client.GetHttpClient(); httpClient.Timeout = new TimeSpan(0, timeout, 0); Refreshing of Bearer token works perfect, but after Refresh Token expires request just hangs with no response and without any exception. here is request example: public async Task GetAsync(string uri) { try { var

How can I combine XAML and a template into one C# template with Rg.Plugins.Popup?

扶醉桌前 提交于 2021-01-28 03:37:55
问题 I would like to simplify the addition of dialog popups in my code to the absolute minimum needed. Currently I have this code: <pages:PopupPage x:Class="Test.Popup" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"> <ContentView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> <t:PopupFrame> <Label Text="ABC" /> <Label Text="ABC" /> </t:PopupFrame> <