Содержание
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.
- Install the Xamarin.CommunityToolkit
- 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 yourMainActivity.cs
(Android project) andAppDelegate.cs
(iOS project) - Change namespace; because the
Expander
is not part of the Toolkit, the namespace changed. Change the namespace fromXamarin.Forms
toXamarin.CommunityToolkit.UI.Views
in all XAML and cs files where you have references. - Rename property references; if you're using
ExpanderState
rename toExpandState
. This enum has been renamed as part of the move. You will most like likely find this in events related to theExpander
.
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.
- Install the Xamarin.CommunityToolkit
- 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 yourMainActivity.cs
(Android project) andAppDelegate.cs
(iOS project) - Change namespace; because the
MediaElement
is not part of the Toolkit, the namespace changed. Change the namespace fromXamarin.Forms
toXamarin.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.