Xamarin.Forms | Xamarin.Forms Official Home | Form library

 by   xamarin C# Version: beta-5.0.0-sr15-pre1 License: Non-SPDX

kandi X-RAY | Xamarin.Forms Summary

kandi X-RAY | Xamarin.Forms Summary

Xamarin.Forms is a C# library typically used in User Interface, Form, Xamarin applications. Xamarin.Forms has no bugs, it has no vulnerabilities and it has medium support. However Xamarin.Forms has a Non-SPDX License. You can download it from GitHub.

Xamarin.Forms provides a way to quickly build native apps for iOS, Android, Windows and macOS, completely in C#. Read more about the platform at

            kandi-support Support

              Xamarin.Forms has a medium active ecosystem.
              It has 5656 star(s) with 1919 fork(s). There are 428 watchers for this library.
              It had no major release in the last 12 months.
              There are 2462 open issues and 7475 have been closed. On average issues are closed in 160 days. There are 81 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Xamarin.Forms is beta-5.0.0-sr15-pre1

            kandi-Quality Quality

              Xamarin.Forms has 0 bugs and 0 code smells.

            kandi-Security Security

              Xamarin.Forms has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Xamarin.Forms code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Xamarin.Forms has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              Xamarin.Forms releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              Xamarin.Forms saves you 1038 person hours of effort in developing the same functionality from scratch.
              It has 2356 lines of code, 11 functions and 5045 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Xamarin.Forms
            Get all kandi verified functions for this library.

            Xamarin.Forms Key Features

            No Key Features are available at this moment for Xamarin.Forms.

            Xamarin.Forms Examples and Code Snippets

            No Code Snippets are available at this moment for Xamarin.Forms.

            Community Discussions


            INotifyPropertyChanged vs BindableObject vs ObservableObject in Xamarin.Forms/MAUI
            Asked 2022-Feb-23 at 13:23

            I have a hard time understanding the difference between those 3 things when creating a project using Xamarin.Forms or MAUI. I know what these are - INotifyPropertyChanged is an interface you need to implement when you want to use bindings in XAML, BindableObject is Xamarin.Forms class that implements said interface and ObservableObject is a class found in Xamarin Community Toolkit that also implements that interface. I just don't really understand the differences between them (especially the latter two) and when you would use any of them? I have read different tutorials and they all say different things - that you need to implement the interface yourself (so your viewmodel implements it), that your viewmodel needs to inherit from BindableObject, or - if you're using Xamarin Community Toolkit (which you probably should use/are using) - inherit from ObservableObject. But - like I said - why should you use any of the solutions mentioned above over the others?

            If you implement INotifyPropertyChanged interface Visual Studio (or ReSharper extension, I'm not sure which one) automatically implements the method it needs to and adds this code:



            Answered 2022-Feb-23 at 12:53

            There is some confusion I think about the different classes:

            • Xamarin.Forms.BindableObject is meant to be used to create something like a custom view with bindable properties. It also implements INotifyPropertyChanged, but I don't think you should use it for a ViewModel.

            • The ObservableObject from the community toolkit can be used as a base class for any class you like to use with data binding, you don't need to implement it yourself.

            • If you have some custom requirements for handling the OnPropertyChanged, you do need to implement the interface yourself, but if you just want to have default behaviour, ObservableObject is perfectly fine.

            Source https://stackoverflow.com/questions/71236324


            requestReview() deprecated in iOS 14, Alternative for xamarin.forms?
            Asked 2022-Jan-27 at 07:39

            I'm using



            Answered 2022-Jan-27 at 07:39

            First, you can try to add SKStoreReviewController.RequestReview(Window.WindowScene) in the FinishedLaunching method of your xxx.ios->AppDelegate.cs; start the project to see if it is correct.

            If the above method goes wrong, using DependencyService is the right way to go.

            Here is the interface code:

            Source https://stackoverflow.com/questions/70831160


            Azure Pipelines Xamarin.Forms iOS build fails with error MSB4057: The target "_IsProjectRestoreSupported" does not exist in the project
            Asked 2022-Jan-26 at 09:39

            We have Xamarin.Forms solution with iOS and UWP projects. We use Azure pipelines to build the iOS project. Until yesterday everything was working fine. Now the build fails at the NuGet Restore step with the error:

            ##[error]The nuget command failed with exit code(1) and error(/Users/runner/work/1/s/"MyProjectName.UWP".csproj : error MSB4057: The target "_IsProjectRestoreSupported" does not exist in the project.

            We can see that the problem occurs when trying to restore NuGet packages for the UWP project on the Mac OS build host. Image: macOS-11

            Workaround will be to exclude it from the solution, but we are using it for testing purposes and this is not a good option for us.



            Answered 2022-Jan-26 at 09:39
            • Updated Answer This can be resolved using MSBuild task instead, as the collogues mentioned below. However, in my case this still lead to the same error. After investigating the pipeline. The root cause has been identified: Both in MSBuild@1 and XamariniOS@2 tasks you should target the specific iOS Project and not the solution file, like so:

            " - task: MSBuild@1 inputs: solution: 'PathToIosProject/myproject.iOS.csproj' configuration: '$(BuildConfiguration)' msbuildArguments: /t:restore

            " - task: XamariniOS@2 inputs: solutionFile: PathToIosProject/myproject.iOS.csproj' configuration: '$(BuildConfiguration)' packageApp: true signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)

            • Old Answer

            We have managed to resolve the issue. The root cause of it seems to be an update to the mono framework in the MacOS pipeline build agent. In order to fix it, we need a script for downloading and installing an older version of the mono framework as a first step of the build pipeline like so: link to the pipeline tasks photo

            This is the code of the bash scrip used in the task:

            #!/bin/bash set -ex


            mkdir -p /tmp/mono-install cd /tmp/mono-install

            mono --version

            wget -q -O ./mono-installer.pkg "$MONO_MACOS_PKG_DOWNLOAD_URL"

            sudo installer -pkg ./mono-installer.pkg -target /

            mono --version

            ls -alh /Library/Frameworks/Mono.framework/Versions/Current

            Source https://stackoverflow.com/questions/69821924


            Xamarin What happens to Lazy initialized singleton after App goes to background
            Asked 2022-Jan-06 at 23:26

            I use Lazy initialization for app singleton in Xamarin.Forms (app runs on iOS):



            Answered 2022-Jan-04 at 20:57

            In this case, there can be race-condition. If two (or more threads) simultaneously reads Instance for first time, there will be created multiple instances of DataSingleton. However every other read will get just one instance. It depends on your scenario, if it is ok.

            Source https://stackoverflow.com/questions/70584186


            Binding property in Xamarin.Forms using MVVM
            Asked 2021-Dec-30 at 00:57

            I have a problem with making a game using Xamarin.Forms and MVVM.

            In the game there's a submarine which is controlled by the user and there are mines falling down so the user has to avoid these mines. The mines are generated in runtime using 2 timers, so I represent these with a CollectionView in XAML.

            I already made this game using WPF (and also using WinForms) and in that case I used Canvas for the game area (ItemsControl for the mines) and the bindings works well. Now (using Xamarin.Forms) I tried implementing the game area with AbsoluteLayout and with RelativeLayout, but always received eg. the following output (RelativeLayout):

            [0:] Binding: '160' cannot be converted to type 'Xamarin.Forms.Constraint'

            The current XAML code:



            Answered 2021-Dec-30 at 00:57

            From the error: [0:] Binding: '160' cannot be converted to type 'Xamarin.Forms.Constraint' You can see that it can't convert the integer to the type Constraint that is expected by the binding expression.

            When you do this:

            Source https://stackoverflow.com/questions/70526383


            Xamarin Forms Android Error inflating class MaterialCalendarGridView
            Asked 2021-Dec-17 at 22:12

            I get the following Error message after migrating from FormsApplicationActivity to FormsAppCompatActivity:

            Android.Views.InflateException: 'Binary XML file line #31 in com.myapp.app:layout/mtrl_calendar_month_labeled: Binary XML file line #18 in com.myapp.app:layout/mtrl_calendar_month: Error inflating class com.google.android.material.datepicker.MaterialCalendarGridView'

            The error happens in the OnCreate at the first line base.OnCreate(savedInstanceState);

            My mainactivity looks like this



            Answered 2021-Dec-17 at 21:30

            I was able to fix the exception, but now my toolbar is completely gone and I created a new stackoverflow post for that problem: Xamarin Forms Android Toolbar missing after migration to Flyout and AppCompat

            The solution for this problem here was to delete the layout.xml file and to use the following values in the styles.xml file:

            Source https://stackoverflow.com/questions/70386380


            Honor. Exception after updating system
            Asked 2021-Dec-03 at 19:00

            Using Xamarin.Forms to built Android app. Phone Honor 30i. Android 10. Build version After updating on this build(dont remember version of previously installed build) my app throw exception in log and crash at once after launch. this is from log:



            Answered 2021-Dec-01 at 02:59

            Thank you for providing the information regarding this issue, we have reported it to the R&D team. at the same time, we have provided a workaround, you can downgrade the Account SDK version to, which should solve your problem.

            Source https://stackoverflow.com/questions/70168944


            Method 'UIKit.UIApplication.Main' is obsolete: Use the overload with 'Type' instead of 'String' parameters for type safety
            Asked 2021-Nov-17 at 20:38

            After upgrade my Xamarin.Forms version to, I'm getting the following warning in Main.cs file inside my iOS project:



            Answered 2021-Nov-17 at 20:38

            Class reference through a string is now deprecated. You need to change this line:

            Source https://stackoverflow.com/questions/70011243


            Why awaiting in App.OnStart() before setting the MainPage property doesn't load main page
            Asked 2021-Nov-12 at 13:08

            First of all, I know the documentation states that I should set the MainPage property in the App class constructor (https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/application-class#mainpage-property).

            To simplify, what I need to do is some async operation in the OnStart() event handler and after that, set the MainPage property. This question wants to get to the root issue in the framework itself.

            Something like this (simplified on a blank Xamarin.Forms project, you can try if you want):



            Answered 2021-Nov-12 at 13:08

            As you can see, OnStart returns void, not Task, so it's not intended to be asynchronous. You made it async void but caller (framework code which calls OnStart) has no means to wait for that async operation to complete. For caller, OnStart completes right when await Task.Delay hits (that's when OnStart returns), and so it continues to other stuff. When await Task.Delay completes and you set MainPage - you are not actually in OnStart stage of initialization process, that stage has already been completed 100 milliseconds ago.

            Consider this example which should clarify it:

            Source https://stackoverflow.com/questions/69943109


            CollectionView, SelectedItems="{Binding SelectedElement, Mode=TwoWay}" Didn't work
            Asked 2021-Nov-08 at 08:29

            I am trying to bind the "SelectedItems" property of my CollectionView between my View and my ViewModel. But the TwoWay didnt work.

            I can send information to my View, but i cant send information to my ViewModel.

            ( all another biding works correctly )

            Some code,in my ViewModel :



            Answered 2021-Nov-07 at 05:14

            Two changes needed:

            1. The type of the bound property (SelectedElement) must match the type of the CollectionView property (SelectedItems). XF Doc says the type is IList.

            2. Your bound property (if the correct type) will get set to the SelectedItems list when the binding is resolved (page is loaded; BindingContext set). It starts out as an empty list. As selection changes, the list's contents change. But the list object itself is the same object, so the setter never gets called again.

            3. So how do you see a change? Via either SelectionChangedCommand, or SelectionChanged event.

              To use SelectionChangedCommand:

              add to CollectionView XAML:

            Source https://stackoverflow.com/questions/69854391

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install Xamarin.Forms

            For both methods underneath you will have to add this NuGet feed for the build to succeed. See this documentation page to find out how.


            How to Contribute
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries