xamarin.forms

Switch templates in xamarin based of bound property (NOT ItemTemplate)

我们两清 提交于 2020-12-14 06:39:14
问题 I have a Model that contains some data, and a field that can have one of three (enum) values. Socket, Tcp, Udp And a View that shows some details. The details that I want shown in the view differ according to the value of this property in the model. I have read all about ItemTemplates for Lists and Pickers, and I want to do something similar but just with a single view bound to a single property. If Socket => Show this view else => Show this other view. Both views have the same viewmodel.

DryIoc and IServiceProvider on Prism for Xamarin.Forms (DryIoc.Microsoft.DependencyInjection)

青春壹個敷衍的年華 提交于 2020-12-13 12:04:05
问题 I've got a Prism application with DryIoc as container. I'd like IHttpClientFactory to provide HttpClient s to my typed clients , which are like this: public class ExampleService : IExampleService { private readonly HttpClient _httpClient; public RepoService(HttpClient client) { _httpClient = client; } public async Task<IEnumerable<string>> GetExamplesAsync() { // Code deleted for brevity. } } In App.xaml.cs I register my typed client so they can be injected in viewmodels with the following:

Color of ScrollBar in ScrollView

蓝咒 提交于 2020-12-13 07:32:50
问题 I use Xamarin.Forms , ScrollView , I can change ScrollView.Background , but background color of scroll bar don't change. How I can do it ? Can I make a universal shared style scrollbar for all platforms? If you can not, can I make so that I could use ScrollView in Shared project Xamarin.forms but at the same time that it is displayed at on different platforms with their own style? Maybe it can be done without their own styles and somehow easier? I need only custom scrollbar color in

Xamarin Forms: How to set a list of items as the Expander Child?

自古美人都是妖i 提交于 2020-12-13 04:33:08
问题 I am using an Expander for showing units and chapters of a book. I am able to show the units as the Expander.Header , but the chapters under the unit is again a list. I tried like below but chapters are not able to view on UI. XAML <StackLayout BindableLayout.ItemsSource="{Binding AllItems,Mode=TwoWay}"> <BindableLayout.ItemTemplate> <DataTemplate> <Expander ExpandAnimationEasing="{x:Static Easing.CubicIn}" ExpandAnimationLength="500" CollapseAnimationEasing="{x:Static Easing.CubicOut}"

Xamarin Forms: How to set a list of items as the Expander Child?

百般思念 提交于 2020-12-13 04:33:00
问题 I am using an Expander for showing units and chapters of a book. I am able to show the units as the Expander.Header , but the chapters under the unit is again a list. I tried like below but chapters are not able to view on UI. XAML <StackLayout BindableLayout.ItemsSource="{Binding AllItems,Mode=TwoWay}"> <BindableLayout.ItemTemplate> <DataTemplate> <Expander ExpandAnimationEasing="{x:Static Easing.CubicIn}" ExpandAnimationLength="500" CollapseAnimationEasing="{x:Static Easing.CubicOut}"

Xamarin Forms: How to set a list of items as the Expander Child?

为君一笑 提交于 2020-12-13 04:32:23
问题 I am using an Expander for showing units and chapters of a book. I am able to show the units as the Expander.Header , but the chapters under the unit is again a list. I tried like below but chapters are not able to view on UI. XAML <StackLayout BindableLayout.ItemsSource="{Binding AllItems,Mode=TwoWay}"> <BindableLayout.ItemTemplate> <DataTemplate> <Expander ExpandAnimationEasing="{x:Static Easing.CubicIn}" ExpandAnimationLength="500" CollapseAnimationEasing="{x:Static Easing.CubicOut}"

How to add custom view in Center of ToolbarItem from Renderer

让人想犯罪 __ 提交于 2020-12-13 04:09:13
问题 I am adding custom view in Center of ToolbarItem from NavigationPageRenderer for android. But it doesn't seems to be working. See my code below public class CustomNavigationPageRenderer : NavigationPageRenderer { public override void OnViewAdded(Android.Views.View child) { base.OnViewAdded(child); var lastPageElement?.Navigation?.NavigationStack?.Last().ToString(); if (lastPage == "ParentDashboardPage") { LayoutInflater li = LayoutInflater.From(Context); Android.Views.View customView = li

Xamarin WKWebView and Cookies

柔情痞子 提交于 2020-12-13 03:39:15
问题 I have a Xamarin Forms app that uses cookies to track login status and uses both HTTPRequests and Webviews, so both need to share cookies. With UIWebView this cookies were shared without any extra management on my part; with WKWebView this appears not to be the case. I have been searching for an explanation on how cookies are handled with WKWebView or an example of how to manually retrieve and set the cookies between these two objects, but have been unable to find any. How do I get the cookie

Xamarin WKWebView and Cookies

落花浮王杯 提交于 2020-12-13 03:32:06
问题 I have a Xamarin Forms app that uses cookies to track login status and uses both HTTPRequests and Webviews, so both need to share cookies. With UIWebView this cookies were shared without any extra management on my part; with WKWebView this appears not to be the case. I have been searching for an explanation on how cookies are handled with WKWebView or an example of how to manually retrieve and set the cookies between these two objects, but have been unable to find any. How do I get the cookie

How to concatenate strings in Xamarin.Forms?

社会主义新天地 提交于 2020-12-08 05:59:50
问题 I want my two strings to be diplayed on just a single line. Is it possible for it to appear like this: Curry Stephen using this code Text="{Binding EMP_LAST_NAME + EMP_FIRST_NAME}" ? ? ? I currently have this code. Thanks a lot. <ListView ItemsSource="{Binding EmployeesList}" HasUnevenRows="True"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Padding="10" RowSpacing="10" ColumnSpacing="5"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid