Skip to main content Skip to footer

Updating Your Xamarin.Forms Projects to Xuni 2015 v2

In order to support Xamarin.iOS and Xamarin.Android platforms, we had to introduce a breaking change in the names of our NuGet packages. Previously our packages were simply named like Xuni.FlexChart, but now each package now clearly identifies the Xamarin Platform it supports in the name. For instance Xuni.Android.XXX is now for Xamarin.Android and Xuni.Forms.XXX is now for Xamarin.Forms. We hope our current users will understand this was a change that we felt was necessary for the long term future of Xuni. In this blog post I'll walk you through updating an existing project to use the latest packages. If you were using a version of Xuni prior to 2015 v2, and you wish to update to the latest version, here are the quick steps you need to take.

Step 1A: Remove old packages (Visual Studio)

  1. With your Solution selected in Visual Studio and select ToolsNuget Package ManagerManage NuGet Packages for Solution…
  2. Under Installed Packages, locate a Xuni control library you are using and click Manage. Xuni_Manage_Package
  3. Uncheck the boxes for each project in your solution and click OK. Unselect_Projects You should see a pop-up that asks if you would like to remove its dependencies as well. Click No, since we do not intend to uninstall Xamarin.Forms packages.
  4. Repeat these steps for each Xuni library in your solution.

Step 1B: Remove old packages (Xamarin Studio)

  1. For each project in your Solution, expand the Packages folder and locate all Xuni packages.
  2. Right-click Xuni.FlexChart, Xuni.FlexPie and Xuni.Gauge and select Remove.
  3. Right-click Xuni.ChartCore and select Remove.
  4. Right-click Xuni.Core and select Remove.

This will remove the packages and references cleanly while also updating the packages.config file. Note that you can achieve the same result from the Project - Edit References... window.

Step 2A: Add new packages (Visual Studio)

Next you need to add the latest Xuni packages to the Solution. Here's how to quickly do that in Visual Studio.

  1. In the NuGet Package Manager under Online, select the GrapeCity source.
  2. Browse through the list until your find the package named Xuni.Forms.XXX where XXX represents the control you are using (FlexChart, FlexPie or Gauges). Manage_Nuget_Packages
  3. Click Install.
  4. Select all of the Projects in your solution. Select_Projects

The packages will then install and all dependencies will be resolved. You should Accept the license and you may be required to restart Visual Studio.

Step 2B: Add new packages (Xamarin Studio)

Here's how to quickly add the new Xuni packages to your solution in Xamarin Studio. Repeat the following steps for each project in your solution.

  1. Right-click the project and select Add - Add NuGet Packages...
  2. In the Add Packages window, select GrapeCity from the source dropdown in the upper left corner (Note: you must install Xuni to see this option).
  3. Browse the list of packages and find the one named Xuni.Forms.XXX where XXX represents the name of the Xuni library being used. Add_Packages_Xamarin_Studio
  4. Check the package and click Add Package.
  5. Repeat these steps for each project selecting the same Xuni package.

Step 3: Update Xuni Namespaces in Code/XAML

Next and finally, you need to update the Xuni namespaces in code and XAML.

  1. In your iOS project, open up the AppDelegate.cs file. In the FinishedLoading method update any of the initialization lines of code from Xuni.Xamarin to Xuni.Forms. Code_Update_Xamarin_Forms_Namespace_iOS
  2. In your Windows Phone project, open up MainPage.xaml.cs. In the page constructor update any of the initialization lines of code from Xuni.Xamarin to Xuni.Forms. Code_Update_Xamarin_Forms_Namespace_WP
  3. Next, open up any pages in your portable project that use the Xuni controls and update the namespaces from Xuni.Xamarin to Xuni.Forms.
  4. Rebuild your project and you should be good to go!

If you have trouble building the project, first check out the list of other name breaking changes in the 2015 v2 release. If that doesn't solve the problem then I encourage you to let us know in the forums and we'll help you get back up and running. Once again, we hope our current users will understand this was a change that we felt was necessary for the long term future of Xuni. With the new structure we are able to share packages intelligently across all Xamarin platforms. For instance, when you add the Xuni.Forms.FlexChart package to your Android project in Xamarin.Forms, you'll notice that it picks up the Xuni.Android.FlexChart packages as well. These are the same packages that would be used if you were developing in a Xamarin.Android project.

ComponentOne Product Manager Greg Lutz

Greg Lutz

comments powered by Disqus