Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Xamarin.Forms for UWP Preview Now Available

$
0
0

Update
For Xamarin.Forms 2.0, the UWP preview is included in the Xamarin.Forms NuGet package. Be sure to read the directions here to get started:

https://developer.xamarin.com/guides/cross-platform/xamarin-forms/windows/getting-started/universal/

Old thread, do not follow
Many in our community have been asking about Xamarin.Forms for Universal Windows Platform support, and today, we are very happy to bring that request to life. In the past, building apps with Xamarin.Forms required you to create a separate Windows Phone and Store applications, but this preview, available to try today, will enable you to target not only iOS and Android, but also multiple Windows 10 platforms from a single app.

This is your chance to try out the latest-and-greatest in Xamarin.Forms. To help ensure that the next release of Xamarin.Forms is functional, stable, and performant, please let us know about any issues you encounter with the new Xamarin.Forms for UWP preview by filing a bug.

Getting Started

Download and extract the attached zip package that contains the preview NuGet packages. You will have to manually add the folder where the files were extracted to Visual Studio 2015’s NuGet package feed list.

Once you have that setup, you will want to:

  • Add a new Blank App (Universal Windows) project to your Xamarin.Forms solutions
  • Ensure the new project is configured to build and deploy in the configuration manager
  • Add the Xamarin.Forms nuget packages to the newly created project
  • Update Xamarin.Forms NuGets in the other projects, and
  • Configure the application by making the following changes to your UWP project code

Update App.xaml.cs

In OnLaunched under:

rootFrame.NavigationFailed += OnNavigationFailed;

Add:

Xamarin.Forms.Forms.Init (e);

Update MainPage.xaml

Remove all contents from page.

Add new xmlns of:

   xmlns:forms="using:Xamarin.Forms.Platform.WinRT"

Update root to:

<forms:WindowsPage
  ...>
</forms:WindowsPage>

Update MainPage.xaml.cs

    public sealed partial class MainPage
    {
        public MainPage()
        {
            InitializeComponent();
            LoadApplication (new YOUR_NAMESPACE.App());
        }
    }

Reference Your PCL/Shared Project

Don’t forget to add your reference to your portable class library or shared project where your Xamarin.Forms logic resides.

Known Issues
  • The look of some views/pages is not yet finalized.
  • There are a couple known crashers around navigation.
  • Text alignment may not be perfect in some titles.
  • Some things still use the older UAP naming. These will change to UWP.

We can’t wait to get your feedback! :)


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>