xamarin.forms

Xamarin forms Shell Custom icon for selected tab

末鹿安然 提交于 2021-02-10 20:36:33
问题 I'm playing with the COOL xamarin shell, but I didn't found a way to change icon of the selected tab. <TabBar Route="sections"> <Tab Title="home"> <Tab.Icon> <FontImageSource FontFamily="{StaticResource AppIcons}" Glyph="{x:Static framework:Icons.HomePage}" /> </Tab.Icon> <ShellContent ContentTemplate="{DataTemplate home:HomePage}" Route="home" /> </Tab> The goal is to use Icons.HomePageFilled instead of Icons.HomePage for this tab only when it's selected. Same logic should apply to other

Xamarin.Forms can you make type related datatemplates?

随声附和 提交于 2021-02-10 19:52:31
问题 In WPF you can create a DataTemplate, put it in a ResourceDictionary, assign it a Type and then bind data of that type to a ContentControl and the DataTemplate will be used to render. as in this example: How do I use the DataType property on a WPF DataTemplate? the Xamarin.Forms enterprise apps ebook hints at such an ability but does not show any example: https://developer.xamarin.com/guides/xamarin-forms/enterprise-application-patterns/mvvm/#Creating_a_View_Defined_as_a_Data_Template Can

Xamarin.form using embedded images

拥有回忆 提交于 2021-02-10 18:35:36
问题 I want to use embedded images in my portable code. I am using a markup extension as many different videos and guides have shown. My project compiles and runs but no image is displayed. These guides say to put the images under "references" but I am unable to drag an image there or right click and add one in so they are in a folder called Images. If the problem is that they aren't under references then how do I get them there? Otherwise if anyone can spot the error that would be much

Did Xamarin forms supports Bing maps insted of Google map native control?

十年热恋 提交于 2021-02-10 17:53:51
问题 We have an requirement for showing Bing maps view in Xamarin forms app for Android and iOS both. We have done the integration of Google maps for both platforms with the help of https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/map#Using_Xaml and https://github.com/amay077/Xamarin.Forms.GoogleMaps. I neither found any documentation that Bing maps supported on Android and iOS nor any thing says it did not support. So How can I get documentation to integrate Bing maps in my

My UWP Application Title Bar isn't changing its foreground color in Xamarin.Forms

邮差的信 提交于 2021-02-10 17:33:53
问题 I'm working on a cross platform app with Xamarin.Forms and on the UWP side, I added this code in MainPage.xaml.cs to change the app title bar to match the navigation bar I'm using: var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.BackgroundColor = Colors.LightSlateGray; titleBar.ForegroundColor = Colors.White; titleBar.InactiveBackgroundColor = Colors.LightSlateGray; titleBar.InactiveForegroundColor = Colors.White; titleBar.ButtonBackgroundColor = Colors.LightSlateGray;

Why tap gesture recognizer wont work in absolute layout?

南笙酒味 提交于 2021-02-10 16:29:00
问题 Developing a project on Android with Xamarin.Forms.I am trying to create a page with six image buttons to navigate the user through the app. Vertically half page, 3 on right side 3 on the left side. No scroll no other things. When I use absolute layout, only images in the bottom of the screen is working. Other imagebuttons didn't work. If I put only 2 images they work. They were in a grid. I deleted grid to try and nothing is changed. <AbsoluteLayout BackgroundColor="Black" AbsoluteLayout

Transparent page in Xamarin.Forms

允我心安 提交于 2021-02-10 16:20:35
问题 I need to be able to create a transparent Xamarin.Forms page for Android. How can I do this true a page renderer? Now it has a default background color. [assembly: ExportRenderer(typeof(MyPage), typeof(ClearBackgroundPageRenderer))] namespace MyApp.Droid { public class ClearBackgroundPageRenderer : PageRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Page> e) { base.OnElementChanged(e); SetBackgroundColor(Color.Transparent.ToAndroid()); } } } 回答1: If you just want

Loading a Font with PdfSharp .Net Standard preview from Xamarin.Forms fails: No appropriate font found

北战南征 提交于 2021-02-10 16:00:06
问题 I am currently assessing how to generate a PDF from Xamarin.Forms (currently running the app on Android, only) and checking the .NET Standard port of PdfSharp. Drawing to the PDF and showing it works, but I'm having issues writing text to the document. When I am trying to load an XFont with the following code var font = new XFont("sans-serif", 20); it fails with the exception System.InvalidOperationException: No appropriate font found. According to these samples, it is supposed to work this

Xamarin Tab Bar top(border) line

一世执手 提交于 2021-02-10 15:54:51
问题 How can I realize the orange line above Tab bar on Android and iOS? 回答1: To achieve this effect, you need to create a custom TabbedPageRenderer. On Android: public class EnhancedTabbedPageRenderer : TabbedPageRenderer { private BottomNavigationView _bottomNavigationView; public EnhancedTabbedPageRenderer(Context context) : base(context) { } protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e) { base.OnElementChanged(e); if (e.NewElement != null) {

LottieUWP embedded into Xamarin.Forms

假装没事ソ 提交于 2021-02-10 14:53:53
问题 I made a custom renderer for LottieUWP [assembly: ExportRenderer(typeof(LottieView), typeof(LottieViewRenderer))] namespace Gorilla.Forms.UWP.Source.Renderer.Lottie { public class LottieViewRenderer : ViewRenderer<LottieView, LottieAnimationView> { private LottieAnimationView AnimationView; protected override void OnElementChanged(ElementChangedEventArgs<LottieView> e) { base.OnElementChanged(e); if (Control == null) { if (e.NewElement == null) return; AnimationView = new LottieAnimationView(