Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Features moved from Xamarin.Forms

Gerald Versluis edited this page Sep 29, 2020 · 2 revisions

There are a couple of controls and features that are moved from Xamarin.Forms to the Xamarin.CommunityToolkit. Underneath you will find a list of these features and the things that are important to know.

Expander

The Expander is one of the controls that moved from Xamarin.Forms to the Xamarin.CommunityToolkit. Because of this, there are a few steps you need to take if you are using the Expander right now and want to continue using it. Find the steps underneath.

  1. Install the Xamarin.CommunityToolkit
  2. Remove experimental flag; if you were using this in Xamarin.Forms, you had to enable the experimental flag for it. This is no longer needed. You will find this in your App.xaml.cs (shared project) or in your MainActivity.cs(Android project) and AppDelegate.cs (iOS project)
  3. Change namespace; because the Expander is not part of the Toolkit, the namespace changed. Change the namespace from Xamarin.Forms to Xamarin.CommunityToolkit.UI.Views in all XAML and cs files where you have references.
  4. Rename property references; if you're using ExpanderState rename to ExpandState. This enum has been renamed as part of the move. You will most like likely find this in events related to the Expander.

That's it! You should now be able to use the Expander as you did before.

MediaElement

The MediaElement is one of the controls that moved from Xamarin.Forms to the Xamarin.CommunityToolkit. Because of this, there are a few steps you need to take if you are using the MediaElement right now and want to continue using it. Find the steps underneath.

  1. Install the Xamarin.CommunityToolkit
  2. Remove experimental flag; if you were using this in Xamarin.Forms, you had to enable the experimental flag for it. This is no longer needed. You will find this in your App.xaml.cs (shared project) or in your MainActivity.cs(Android project) and AppDelegate.cs (iOS project)
  3. Change namespace; because the MediaElement is not part of the Toolkit, the namespace changed. Change the namespace from Xamarin.Forms to Xamarin.CommunityToolkit.UI.Views in all XAML and cs files where you have references.

That's it! You should now be able to use the MediaElement as you did before.