Skip to content
Xamarin.Forms Official Home
C# Batchfile PowerShell Java Shell Makefile
Branch: master
Clone or download
Latest commit e80cba6 Dec 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update contributing guide; tweak pull request template (#7317) Sep 9, 2019
.nuspec #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
AndroidNative [All] ScaleX and ScaleY (#1280) May 7, 2018
Assets Reinstated Xamarin icon for NuGets (#7101) Aug 9, 2019
EmbeddingTestBeds #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
PagesGallery #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
Stubs [Tizen] Add RefreshView for Tizen (#8697) Dec 3, 2019
XFCorePostProcessor.Tasks Merge branch '3.6.0' into 4.0.0 Apr 11, 2019
Xamarin.Flex Merge branch '3.0.0' into 3.1.0 May 7, 2018
Xamarin.Forms.Build.Tasks [X] send tree changed events on parenting (#8760) Dec 6, 2019
Xamarin.Forms.ControlGallery.Android Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.ControlGallery.GTK WPF GTK Set flags (#8446) Dec 2, 2019
Xamarin.Forms.ControlGallery.MacOS [Bug] FontImageSourse doesn't work on macOS (#8590) fixes #8469 Dec 2, 2019
Xamarin.Forms.ControlGallery.Tizen [Shell][Tizen] Add the MaterialShellRenderer on Tizen (#6196) Aug 29, 2019
Xamarin.Forms.ControlGallery.WPF WPF GTK Set flags (#8446) Dec 2, 2019
Xamarin.Forms.ControlGallery.WindowsUniversal Put SwipeView behind experimental flag (#8786) Dec 6, 2019
Xamarin.Forms.ControlGallery.iOS Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.Controls Merge branch '4.4.0' Dec 6, 2019
Xamarin.Forms.Core.Android.UITests [UITests] Update Xamarin.UITests packages (#8725) Dec 3, 2019
Xamarin.Forms.Core.Design [previewer] removed empty ItemsSourse attribute from toolbox snippets ( Nov 7, 2019
Xamarin.Forms.Core.UITests.Shared Fix Bug 7823 - Frame corner radius (#8032) Nov 19, 2019
Xamarin.Forms.Core.UnitTests Add VSM Setter TargetName (#8144) Dec 6, 2019
Xamarin.Forms.Core.Windows.UITests [UITests] Update Xamarin.UITests packages (#8725) Dec 3, 2019
Xamarin.Forms.Core.iOS.UITests [UITests] Update Xamarin.UITests packages (#8725) Dec 3, 2019
Xamarin.Forms.Core.macOS.UITests [UITests] Update Xamarin.UITests packages (#8725) Dec 3, 2019
Xamarin.Forms.Core Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.CustomAttributes Merge branch '4.4.0' Nov 24, 2019
Xamarin.Forms.Maps.Android [Android Maps] Check for location permissions when IsShowingUser=true ( Nov 5, 2019
Xamarin.Forms.Maps.GTK Add separate MarkerClick and InfoWindowClick events for Pins (#6079) Aug 14, 2019
Xamarin.Forms.Maps.MacOS Enable SourceLink for Xamarin.Forms (#6886) fixes #2165 Aug 1, 2019
Xamarin.Forms.Maps.Tizen Merge branch '4.2.0' Aug 17, 2019
Xamarin.Forms.Maps.UWP #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
Xamarin.Forms.Maps.WPF Add separate MarkerClick and InfoWindowClick events for Pins (#6079) Aug 14, 2019
Xamarin.Forms.Maps.iOS [Maps] Add polylines and polygons (#6136) Aug 29, 2019
Xamarin.Forms.Maps [Maps] Add polylines and polygons (#6136) Aug 29, 2019
Xamarin.Forms.Material.Android Fix corner clipping on ImageButton and Button (FR) (#7723) Nov 5, 2019
Xamarin.Forms.Material.Tizen [Tizen] Add Meterial Stepper Renderer (#8037) Oct 17, 2019
Xamarin.Forms.Material.iOS fix #5518 | Frame Tap Gesture not working when using Visual="Material… Dec 4, 2019
Xamarin.Forms.Pages.Azure #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
Xamarin.Forms.Pages.UnitTests [Tests]Update to Xamarin.UITest 3.0 and NUnit 3.0 (#6332) (#7031) Sep 10, 2019
Xamarin.Forms.Pages #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
Xamarin.Forms.Platform.Android.AppLinks Merge 4.2.0 into 4.3.0 Sep 10, 2019
Xamarin.Forms.Platform.Android.FormsViewGroup Merge branch '3.6.0' into 4.0.0 May 22, 2019
Xamarin.Forms.Platform.Android Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.Platform.GTK Merge branch '4.4.0' Dec 5, 2019
Xamarin.Forms.Platform.MacOS Merge branch '4.4.0' Dec 5, 2019
Xamarin.Forms.Platform.Tizen Remove unnecessary Lazy loading (#8798) Dec 9, 2019
Xamarin.Forms.Platform.UAP Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.Platform.WPF Remove private modifier (#8631) Dec 3, 2019
Xamarin.Forms.Platform.iOS Merge branch '4.4.0' Dec 9, 2019
Xamarin.Forms.Platform Added IndicatorsView (#7465) Nov 23, 2019
Xamarin.Forms.Sandbox.Android/Resources/drawable centralize bottom nav behaviors so all the bottom navs work the same (#… Sep 27, 2019
Xamarin.Forms.Xaml.Design #3533 Bring back uap10.0/netstandard1.4 support (#7079) fixes #3533 Nov 22, 2019
Xamarin.Forms.Xaml.UnitTests Add VSM Setter TargetName (#8144) Dec 6, 2019
Xamarin.Forms.Xaml Merge branch '4.4.0' Dec 6, 2019
build Merge branch '4.2.0' into 4.3.0 Nov 4, 2019
docs Implemented colored refresh indicator for ListView pull-to-refresh (#… Nov 29, 2018
tools/mdoc Add missing mdoc tooling Mar 23, 2016
.Xamarin.Forms.Android.nuget.sln Profiler v11; No man init (#6087) May 7, 2019
.Xamarin.Forms.Android.slnf update dot files Jul 26, 2019
.Xamarin.Forms.UAP.nuget.sln fixes .create-nuget script (#6913) Jul 29, 2019
.Xamarin.Forms.UAP.slnf update dot files Jul 26, 2019
.Xamarin.Forms.iOS.nuget.sln update partial slns Jul 23, 2019
.Xamarin.Forms.iOS.slnf update partial slns Jul 23, 2019
.Xamarin.forms.nuget.sln fixes .create-nuget script (#6913) Jul 29, 2019
.Xamarin.forms.nuget.slnf update dot files Jul 26, 2019
.create-nuget.bat update create-nuget.bat Aug 27, 2019
.create-stubs.bat Update dot file Sep 18, 2019
.editorconfig Added the style from .NET Foundation plus variances (#4575) Dec 7, 2018
.gitattributes try to avoid merge conflicts in GitInfo.txt (#5715) Apr 3, 2019
.gitconfig try to avoid merge conflicts in GitInfo.txt (#5715) Apr 3, 2019
.gitignore set XF Verions File to be hidden (#8128) Oct 21, 2019
.xtc-manual-ios.bat Update xtc-manual-ios.bat Nov 8, 2017
Directory.Build.props [build] cleanup MSBuild settings for faster builds (#7381) Sep 6, 2019
Directory.Build.targets [Build] Update builds, remove submodule, update AssemblyInfo with Git… May 22, 2019
GitInfo.txt Update GitInfo.txt Oct 24, 2019
LICENSE Fix license copy Apr 29, 2016
Makefile [docs] use local mdoc (#1321) Dec 5, 2017
README.md Update Android UI test instructions (#7579) Sep 26, 2019
SECURITY.md Add SECURITY.md (#7373) Sep 4, 2019
Version.targets fix generating nugets (#8660) Nov 26, 2019
Xamarin.Forms.mdpolicy Add Xamarin.Forms code policy file for XamarinStudio Mar 28, 2016
Xamarin.Forms.sln remove sandbox (#6993) Jul 29, 2019
Xamarin.Forms.sln.DotSettings [Shell,iOS,Android] Add Colors, Font, HorizontalAlignment. Keyboard, … May 9, 2019
Xamarin.Forms.vssettings Update vssettings file to turn on Wrapping_PreserveSingleLine (#115) Apr 24, 2016
azure-pipelines.yml Revert back to VS 2017 (#8770) Dec 5, 2019
banner.png [README] Add Xamarin.Forms banner (#757) Feb 9, 2017
build.cake Merge branch '4.3.0' into 4.4.0 Nov 4, 2019
build.cmd Make building easier on Windows by setting PowerShell execution polic… Jul 2, 2019
build.ps1 Cake build script (#5074) Feb 12, 2019
build.sh Cake build script (#5074) Feb 12, 2019
debug.keystore Add missing debug.keystore Mar 23, 2016
xamarin.forms.snk [build] Version and strongname the Build.Tasks (#3118) Jun 28, 2018

README.md

Xamarin.Forms banner

Xamarin.Forms

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 https://www.xamarin.com/forms.

Build Status

Azure DevOps

Packages

Platform/Feature Package name Stable Prerelease Nightly Feed Azure (master branch)
Core Xamarin.Forms NuGet NuGet
AppLinks Xamarin.Forms.AppLinks NuGet NuGet
Maps Xamarin.Forms.Maps NuGet NuGet
Maps.GTK Xamarin.Forms.Maps.GTK NuGet NuGet
Maps.WPF Xamarin.Forms.Maps.WPF NuGet NuGet
Pages Xamarin.Forms.Pages NuGet NuGet
Pages.Azure Xamarin.Forms.Pages.Azure NuGet NuGet
Platform.GTK Xamarin.Forms.Platform.GTK NuGet NuGet
Platform.WPF Xamarin.Forms.Platform.WPF NuGet NuGet
Visual.Material Xamarin.Forms.Visual.Material NuGet NuGet

If you want to use the latest dev build then you should read this blog post:

  • Add the nightly feed to your NuGet sources or add a NuGet.Config to your app (placing it in the same directory where your solution file is) with the following content:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <clear />
        <add key="xamarin-ci" value="https://aka.ms/xf-ci/index.json" />
        <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
      </packageSources>
    </configuration>

    NOTE: This NuGet.Config should be with your application unless you want nightly packages to potentially start being restored for other apps on the machine.

  • Change your application's dependencies to have a * to get the latest version.

Getting Started

Windows

Install Visual Studio 2017+

VS 2017+ is required for developing Xamarin.Forms. If you do not already have it installed, you can download it here. VS 2017+ Community is completely free. If you are installing VS 2017+ for the first time, select the "Custom" installation type and select the following from the features list to install:

  • .NET desktop development - In the Summary > Optional select .NET Framework 4.7 SDK, .NET Framework 4.7 targeting pack.
  • Universal Windows Platform Development - In the Summary > Optional select the Windows 10 Mobile Emulator.
  • Mobile Development with .NET - In the Summary > Optional select Xamarin Remoted Simulator, Xamarin SDK Manager, Intel Hardware Accelerated Execution Manager (HAXM)

The Android 7.0 Nougat API 24 SDK is required for developing Xamarin.Forms. It can be installed by using the Xamarin Android SDK Manager.

We also recommend installing Xamarin Android Device Manager This will use the HAXM tools installed above and allow you to configure Android Virtual Devices (AVDs) that emulate Android devices. If you already have VS 2017+ installed, you can verify that these features are installed by modifying the VS 2017+ installation via the Visual Studio Installer.

Mac

Install Visual Studio for Mac 2019

If you do not already have it installed, instructions to download and setup can be found here.

Because of current Multi-Targeting limitations with Visual Studio for Mac you will need to manually build/restore some projects before you are able to work on the Xamarin Forms solution.

Here are a few different options we've put together to help make this process easier

  • Branches 3.5+ come with a Cake script target that you can use to build and open VSMac
./build.sh --target vsmac
  • When working on an earlier branch that does not have the cake scripts then you can use the following [build.sh] script(https://gist.github.com/PureWeen/92c1e1aff0c257c3decf0bcb8d6e9296)

  • If you don't want to run any scripts then

    • Open Xamarin.Forms.sln
    • Wait for VSMAC to finish restoring all projects
    • from the command line run:
      • msbuild Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj
    • Now you should be able to run and deploy everything. The only reason you would need to do this process again is if you clean the solution folder or delete the bin/obj folders that are part of the Xamarin.Forms.Build.Tasks.csproj

If you are on Visual Studio for Mac 2017 you will need to turn off automatic package restore (Visual Studio => Preferences => Nuget => General => uncheck the Package Restore box) before working on the Xamarin.Forms solution. This step is no longer needed with Visual Studio for Mac 2019

Solution Configuration

Upon opening the Xamarin.Forms solution, you will find that there are a number of errors and warnings under the Error List pane; you can resolve this by changing the filter of Build + IntelliSense to Build Only. At this point, you should be able to successfully build the solution.

By default, the Xamarin.Forms.Controls project does not have a configuration for various API keys to access certain features on each platform (e.g. maps). When building the solution the first time, a controlgallery.config file will be generated inside that project, which looks like this:

UWPMapsAuthKey:

You will have to obtain your own API keys for each of these services, inserted directly after the identifier (e.g. UWPMapsAuthKey:abcdefghijklmnopqrstuvwxyz). You can find out how to obtain each of these as follows:

Due to the way that Android works, the maps API key cannot be injected at runtime. As a result, you will have to add this key to the MapsKey.cs file under Xamarin.Forms.ControlGallery.Android/Properties:

[assembly: Android.App.MetaData("com.google.android.maps.v2.API_KEY", Value = "INSERT_KEY_HERE")]

You can find out how to obtain a Google Maps API key here.

Build from the Command line

Make sure you have nuget.exe 4.0 or above and the latest dotnet core sdk (2.0.3). On macOS you should specify the platform in the msbuild command (/p:Platform=iPhoneSimulator)

msbuild /restore Xamarin.Forms.sln

UI Tests

Run Android UI Tests

Depending on your environment setup, you might need to configure a few things before being able to debug / run UI tests, especially on Windows.

  • If you receive an error about ANDROID_HOME, please make sure to set your environment variable to the Android SDK directory (e.g. C:\Program Files (x86)\Android\android-sdk).
  • If you receive an error about JAVA_HOME, please install the latest Java JDK and set your environment variable to the JDK directory (e.g. C:\Program Files\Java\jdk-13).
  • If you receive an error about a missing ApkFile, please generate an APK file for Xamarin.Forms.ControlGallery.Android. The easiest way to do this is to right click the project and select "Deploy". Note that if you rebuild the solution, you might lose the APK and will need to generate it again.

After these steps are taken care of, you should be good to go. You can see all UI tests in Test Explorer, search them for your own convenience, and quickly run individual tests.

Run UWP UI Tests

To run the UWP UI Tests:

  1. Install and run the Windows Application Driver.
  2. Launch the Xamarin.Forms.ControlGallery.WindowsUniversal project to install the ControlGallery application onto your system.

You should now be able to run any of the UWP UI Tests.

Coding Style

We follow the style used by the .NET Foundation, with a few exceptions:

  • We do not use the private keyword as it is the default accessibility level in C#.
  • We use hard tabs over spaces. You can change this setting in VS 2015 via Tools > Options and navigating to Text Editor > C# and selecting the "Keep tabs" radio option. In Visual Studio for Mac it's set via preferences in Source Code > Code Formatting > C# source code and disabling the checkbox for Convert tabs to spaces.
  • Lines should be limited to a max of 120 characters (or as close as possible within reason). This may be set in Visual Studio for Mac via preferences in Source Code > Code Formatting > C# source code and changing the Desired file width to 120.

Contributing

Reporting Bugs

We use GitHub Issues to track issues. If at all possible, please submit a reproduction of your bug along with your bug report.

You can’t perform that action at this time.