xamarin.forms

How to multitarget in Xamarin.Forms with Visual Studio for Mac?

别等时光非礼了梦想. 提交于 2021-02-10 14:40:27
问题 I started out creating a .NET Standard Library that I intended to make a NuGet of - but came to find that I also needed platform-specific functionality. So, I found this stack overflow question - which indicated I could use a Multiplatform Library template instead. But here I encountered a problem with DependencyService - and a problem with Custom Renderer - effectively meaning that there was no way for the non-platform-specific to communicate with platform-specific code in the library. I

Costumize style of the selected (current) FlyoutItem

浪子不回头ぞ 提交于 2021-02-10 14:39:26
问题 I've noticed that when I customize flyout item appearance like it says here in the docs, the current FlyoutItem is not marked anymore. Snip of the code from docs to change the item appearance: <Shell ...> ... <Shell.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.2*" /> <ColumnDefinition Width="0.8*" /> </Grid.ColumnDefinitions> <Image Source="{Binding FlyoutIcon}" Margin="5" HeightRequest="45" /> <Label Grid.Column="1" Text="{Binding Title}"

How to multitarget in Xamarin.Forms with Visual Studio for Mac?

陌路散爱 提交于 2021-02-10 14:38:39
问题 I started out creating a .NET Standard Library that I intended to make a NuGet of - but came to find that I also needed platform-specific functionality. So, I found this stack overflow question - which indicated I could use a Multiplatform Library template instead. But here I encountered a problem with DependencyService - and a problem with Custom Renderer - effectively meaning that there was no way for the non-platform-specific to communicate with platform-specific code in the library. I

Xamarin.Forms: Read Data using UsbDeviceConnection Library

霸气de小男生 提交于 2021-02-10 14:34:07
问题 I Have to read data from UsbDeviceConnection but the call UsbDeviceConnection.BulkTransfer(......) always returns -1. when I have to write data, all works fine, but when I try to receive, the call always returns -1 (receive failed). [Obsolete] public string ConnectAndRead() { // Get a usbManager that can access all of the devices var usbManager = (UsbManager)Forms.Context.GetSystemService(Context.UsbService); while(usbManager.DeviceList.Count == 0) { Debug.WriteLine($"Nessun dispositivo

Xamarin.Forms: Read Data using UsbDeviceConnection Library

和自甴很熟 提交于 2021-02-10 14:31:45
问题 I Have to read data from UsbDeviceConnection but the call UsbDeviceConnection.BulkTransfer(......) always returns -1. when I have to write data, all works fine, but when I try to receive, the call always returns -1 (receive failed). [Obsolete] public string ConnectAndRead() { // Get a usbManager that can access all of the devices var usbManager = (UsbManager)Forms.Context.GetSystemService(Context.UsbService); while(usbManager.DeviceList.Count == 0) { Debug.WriteLine($"Nessun dispositivo

Exception has been thrown by the target of an invocation in Xamarin

夙愿已清 提交于 2021-02-10 12:41:35
问题 Here is the Code (Run this to see what's the problem) => https://github.com/x0axz/CustomRenderer In my Xamarin App, there is a Custom Camera Renderer for Android, which is being called from ViewModel through MessagingCenter.Send<object>(this, "A"); . It's working fine. The only problem is that, on first page it takes Picture, but when I navigate to another page, where there is an other command, MessagingCenter.Send<object>(this, "A"); , to take a Picture, but this time it returns an error

UITests Post Failed in Xamarin.forms

微笑、不失礼 提交于 2021-02-10 11:52:11
问题 I've created a fresh Xmarain.Forms project and a fresh Xmarain.Forms UI Tests project. I've managed to get the freshly created Android apk built and installed to my emulated device. My Unit Tests application is able to connect to the installed apk. When it attempts to run the first test I get the following error though: System.Net.WebException : POST Failed at Xamarin.UITest.Shared.Http.HttpClient.HandleHttpError(String method, HttpResponseMessage response, ExceptionPolicy exceptionPolicy) at

UITests Post Failed in Xamarin.forms

泪湿孤枕 提交于 2021-02-10 11:49:07
问题 I've created a fresh Xmarain.Forms project and a fresh Xmarain.Forms UI Tests project. I've managed to get the freshly created Android apk built and installed to my emulated device. My Unit Tests application is able to connect to the installed apk. When it attempts to run the first test I get the following error though: System.Net.WebException : POST Failed at Xamarin.UITest.Shared.Http.HttpClient.HandleHttpError(String method, HttpResponseMessage response, ExceptionPolicy exceptionPolicy) at

How to set all the item template data into a single view in Xamarin Carousel

≡放荡痞女 提交于 2021-02-10 06:47:09
问题 I have tried to make all the items in the itemtemplate into a single view as like in the below image, how to achieve this by using Xamarin CarouselView, i am using like this carousel = new CarouselView(); carousel.BindingContext = this; carousel.ItemTemplate = itemTemplate; carousel.SetBinding(CarouselView.ItemsSourceProperty, new Binding(nameof(this.Items), mode: BindingMode.OneWay)); LinearItemsLayout linearItemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal);

How to set all the item template data into a single view in Xamarin Carousel

痴心易碎 提交于 2021-02-10 06:46:11
问题 I have tried to make all the items in the itemtemplate into a single view as like in the below image, how to achieve this by using Xamarin CarouselView, i am using like this carousel = new CarouselView(); carousel.BindingContext = this; carousel.ItemTemplate = itemTemplate; carousel.SetBinding(CarouselView.ItemsSourceProperty, new Binding(nameof(this.Items), mode: BindingMode.OneWay)); LinearItemsLayout linearItemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal);