The following information is based on pre-release software and documentation and is subject to change an inaccuracies.
The Xamarin.Forms team has released a technical preview of Xamarin.Forms 1.3.0. As is now the standard, this is a Nuget package which is attached to the announcement but you will need to download and install it manually.
In this article we will cover:
- Installation of the 1.3.0 package
- Explore the changes to the base Xamarin Application configuration
The sample code is available here:
Xamarin.Forms 1.3.0 Technical Preview Installation
After you have downloaded and unzipped the Nuget package, perform the following steps to install the Nuget package.
Add a Package Source Location
1. Select Tools, Nuget Package Manager, Package Manager Settings:
2. Select Package Sources:
3. Then Click the Plus sign over the Available package sources list.
4. Edit the Name and Source folder as required, then click the Update button.
5. Click OK to save your changes.
Create a new Xamarin Forms Project using 1.3.0
For this discussion, we’re going to start from scratch and create a new Xamarin.Forms project.
After the solution and projects have been created, we need to update our Xamarin.Forms package:
1. Select Tools, Nuget Package Manager, Manage Nuget Packages for Solution.
2. Expand Updates.
3. Select the Package Source you created in the previous steps:
4. Select Xamarin.Forms v1.3.0.pre0 (the only one list).
5. Click the Update button.
Assuming everything went as planned, you should now be running Xamarin.Forms 1.3.0.
Introducing the XamarinApplication Class
There is a new class which will be the basis for our Xamarin.Forms applications from this point forward.
Here is a brief overview of what is included:
- Supports easy changing of root page
- Persistent data store via Properties dictionary
- Sleep/Resume/Start events
- Application level resource dictionary
Let’s review the basic structure changes to the Shared and Platform-specific code.
Shared-Code Application Class
Here is how our App code looks:
public class MyApp : Application
MainPage = new ContentPage
Content = new Label
Text = "Hello, Forms !",
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
protected override void OnResume()
protected override void OnSleep()
protected override void OnStart()
As you can see, we now inherit from Application and there are three new methods to help us handle various Application-wide events.
Also notice that our GetMainPage method has been replaced with a MainPage property.
The AppDelegate class in the iOS application now looks like this:
public partial class AppDelegate : FormsApplicationDelegate
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
return base.FinishedLaunching(app, options);
Notice we are inheriting from FormsApplicationDelegate and the LoadApplication method is now handling all of the user interface initialization and the passing of the application’s main screen back to the phone.
Here is how the MainActivity looks:
public class MainActivity : FormsApplicationActivity
protected override void OnCreate(Bundle bundle)
Notice we are inheriting from FormsApplicationActivity and the LoadApplication method call is doing the work of setting up our interface.
Windows Phone MainPage
Here is the Windows Phone implementation”":
public partial class MainPage : FormsApplicationPage
This setup is the same as the other two but in this case, the page is inherited from FormsApplicationPage.
Don’t forget to modify your XAML to reflect the base class:
Again, this is all preliminary information. I’ll try and dig deeper as more information becomes available.