|}
== Mandatory ==
=== Namespace conversion ===
'''Update all namespaces to MAUI equivalents.'''
All `xmlns` and `clr-namespace` declarations must be updated to their MAUI counterparts.
{| class="wikitable"
! Xamarin
! MAUI
|-
| xmlns="http://xamarin.com/schemas/2014/forms"
| xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|-
| clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core
| clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls
|-
| clr-namespace:UBIK.CPL.Behaviors;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Behaviors;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Classes;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Classes;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Controls;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Controls;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Converters;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Converters;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Platform.Renderers;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Platform.Controls;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Services;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Services;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.CPL.Resources;assembly=UBIK.CPL
| clr-namespace:UBIK.MAUI.Resources;assembly=UBIK.MAUI
|-
| clr-namespace:UBIK.Scanning.Forms;assembly=UBIK.Scanning.Forms
| clr-namespace:UBIK.MAUI.Controls.ZXingScanner;assembly=UBIK.MAUI
|-
| clr-namespace:Syncfusion.SfPullToRefresh.XForms;assembly=Syncfusion.SfPullToRefresh.XForms
| clr-namespace:Syncfusion.Maui.Toolkit.PullToRefresh;assembly=Syncfusion.Maui.Toolkit
|-
| clr-namespace:Syncfusion.XForms.TabView;assembly=Syncfusion.SfTabView.Xforms
| clr-namespace:Syncfusion.Maui.Toolkit.TabView;assembly=Syncfusion.Maui.Toolkit
|-
| clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms
| clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView
|-
| clr-namespace:Syncfusion.XForms.TreeView;assembly=Syncfusion.SfTreeView.XForms
| clr-namespace:Syncfusion.Maui.TreeView;assembly=Syncfusion.Maui.TreeView
|-
| clr-namespace:Syncfusion.XForms.TextInputLayout;assembly=Syncfusion.Core.XForms
| clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core
|}
=== Syncfusion control updates ===
'''There are some other properties that have changed their names on SfListView/SfListViewExt. We don't use them in our standard XAMLs. But if you use them in customizings, please refer to https://help.syncfusion.com/maui/listview/migration for the complete list.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
SfListViewExt:
* ItemHolding
</syntaxhighlight>
| ItemLongPress
|}
=== Syncfusion control updates ===
{| class="wikitable"
! Xamarin
! MAUI
|-
| * LeftSwipeTemplate, RightSwipeTemplate
| StartSwipeTemplate, EndSwipeTemplate
|}
=== Namespace conversion ===
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
* <sync:SfListView.LayoutManager>
</syntaxhighlight>
| <syntaxhighlight lang="xml">
<sync:SfListView.ItemsLayout>
</syntaxhighlight>
|}
=== Namespace conversion ===
'''1. We need to add the following namespace where the changes are applied:
xmlns:services="clr-namespace:UBIK.MAUI.Services;assembly=UBIK.MAUI";
2. We need to search for both "StaticResource" and "DynamicResource";
3. We only listed some examples here. But the same rule applies to all those templates exacted from UBIKThemes (see those under the "Recommended" sheet's A2 cell).'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| {StaticResource UBIKChildItem}
| {Binding [UBIKChildItem], Source={x:Static services:TemplateService.Instance}}
|}
=== TemplateService binding for extracted templates ===
{| class="wikitable"
! Xamarin
! MAUI
|-
| {StaticResource UBIKDocumentItem}
| {Binding [UBIKDocumentItem], Source={x:Static services:TemplateService.Instance}}
|}
=== TemplateService binding for extracted templates ===
{| class="wikitable"
! Xamarin
! MAUI
|-
| {StaticResource UBIKMainItem}
| {Binding [UBIKMainItem], Source={x:Static services:TemplateService.Instance}}
|}
=== OnPlatform and OnIdiom syntax changes ===
{| class="wikitable"
! Xamarin
! MAUI
|-
| ...
| ...
|}
=== OnPlatform and OnIdiom syntax changes ===
'''All code containing the OnPlatform functionality needs to be refactored as the syntax changed. It is recommended to use the inline syntax (see example) as a default wherever possible, but there are also other approaches.
When using Bindings, Resources or other complex values in OnIdiom or OnPlatform values, it should only be used with the inline syntax.
Please rely to the wiki for more details and possibilities (e.g. if the value contains multiple elements): https://wiki.augmensys.com/index.php?title=XAML_Tips#Platform_and_Device-specific_UI_with_OnPlatform_and_OnIdiom'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| OnPlatform
| <syntaxhighlight lang="xml">
<TheControl
...
TheProperty="{OnPlatform Android=False, iOS=True}" />
<TheControl
...
TheProperty="{OnPlatform Android={Binding ...}, iOS={Binding ...}}" />
</syntaxhighlight>
|}
=== OnPlatform and OnIdiom syntax changes ===
'''All code containing the OnIdiom functionality needs to be refactored as the syntax changed. It is recommended to use the inline syntax (see example) as a default wherever possible, but there are also other approaches like the multi-tag syntax.
When using Bindings, Resources or other complex values in OnIdiom or OnPlatform values, it should only be used with the inline syntax.
Please rely to the wiki for more infos: https://wiki.augmensys.com/index.php?title=XAML_Tips#Platform_and_Device-specific_UI_with_OnPlatform_and_OnIdiom'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| OnIdiom
| <syntaxhighlight lang="xml">
<TheControl
...
TheProperty="{OnIdiom Phone=False, Desktop=True}" />
<TheControl
...
TheProperty="{OnIdiom Desktop={Binding ...}, Phone={Binding ...}}" />
</syntaxhighlight>
|}
=== OnPlatform and OnIdiom syntax changes ===
'''In the scope of any OnPlatform/On Platform, WinPhone needs to be replaced with WinUI.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| WinPhone
| WinUI
|}
=== OnPlatform and OnIdiom syntax changes ===
'''When using GridLength as a type (e.g. in ColumDefinition.Width or RowDefinition.Height) in OnIdiom or OnPlatform, it should only be used with the inline syntax. More infos see in the wiki: https://wiki.augmensys.com/index.php?title=XAML_Tips#Platform_and_Device-specific_UI_with_OnPlatform_and_OnIdiom'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
e.g.
<ColumnDefinition.Width>
<OnIdiom
...
Desktop="Auto"
Phone="*" />
</ColumnDefinition.Width>
or
<RowDefinition.Height>
<OnPlatform
...
Android="Auto"
iOS="*" />
</RowDefinition.Height>
</syntaxhighlight>
| <syntaxhighlight lang="xml">
<ColumnDefinition Width="{OnIdiom Desktop='Auto', Phone='*'}" />
<RowDefinition Height="{OnPlatform Android='Auto', iOS='*'}" />
</syntaxhighlight>
|}
=== Syncfusion control updates ===
'''It is necessary to use the default Binding with the Source reference to the parent control instead of TemplateBinding when using a SfListViewExt ControlTemplate with selectable items in the ResourceDictionary to be set in the ContentView DataTrigger. Otherwise, the pre-selected items might not appear selected anymore according to our experience.
Affected standard Xamls are:
- UBIKEditDouble
- UBIKEditInt
- UBIKEditString
- UBIKEditMinMax
(For the exact syntax please refer to our latest standard Xamls.)
If the above explained is also used in any custom Xamls, please consider changing it there, too.
However, the problem only seems to occur if there is TemplateBinding in the ItemsSource & SelectedItem property. But, for example, if the TemplateBinding is only in the BindingContext property of the SfListViewExt (like it is the case in the UBIKPropertyDirectEditListPopup), there seems to be no such problem and therefore no change is necessary.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
<ContentView
...
x:Name="YourContentViewName">
<ContentView.Resources>
<ResourceDictionary>
...
<ControlTemplate x:Key="YourTemplateKey">
<ctrls:SfListViewExt
ItemsSource="{TemplateBinding BindingContext.YourBinding,
...}"
SelectedItem="{TemplateBinding BindingContext.YourBinding,
...}"
... />
</ControlTemplate>
...
</ResourceDictionary>
</ContentView.Resources>
...
</ContentView>
</syntaxhighlight>
| <syntaxhighlight lang="xml">
<ContentView
...
x:Name="YourContentViewName">
<ContentView.Resources>
<ResourceDictionary>
...
<ControlTemplate x:Key="YourTemplateKey">
<ctrls:SfListViewExt
ItemsSource="{Binding BindingContext.YourBinding,
Source={x:Reference YourContentViewName},
...}"
SelectedItem="{Binding BindingContext.YourBinding,
Source={x:Reference YourContentViewName},
...}"
... />
</ControlTemplate>
...
</ResourceDictionary>
</ContentView.Resources>
...
</ContentView>
</syntaxhighlight>
|}
=== Remove default ControlTemplate in DataTriggers ===
'''To prevent an issue on Android where the direct edit Link to Object editor does not open, there is a change necessary in the UBIKPropertyDirectEditListPopup Xaml:
The default ControlTemplate needs to be removed from the ContentView that contains the DataTriggers.
According to our experience, this issue only occurs to our UBIKPropertyDirectEditListPopup standard Xaml, but we can't guarantee that there is no such issue in customized Xamls.
So please, if you encounter an issue on Android where a Property Editor doesn't open, report it the mobile development team, and/or try removing the default ControlTemplate from the affected control.
In our standard Xamls, we removed the default ControlTemplate in every ContentView that contains DataTriggers with ControlTemplates where the same template is already set in a DataTrigger. So please, also remove the default ControlTemplates it in the following Xamls if you use customized ones:
- UBIKEditDouble
- UBIKEditInt
- UBIKEditString
- UBIKEditMinMax
(For the exact syntax please refer to our latest standard Xamls.)
If the above explained is also used in any of your other custom Xamls, please consider changing it there, too. Otherwise, some property editor might not open.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
<ContentView x:Name="containerName" ControlTemplate="{StaticResource YourTemplate}">
<ContentView.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference containerName}, Path=...}"
TargetType="ContentView"
Value="true">
<Setter Property="ControlTemplate"
Value="{StaticResource YourTemplate}" />
</DataTrigger>
...
</ContentView.Triggers>
</ContentView>
</syntaxhighlight>
| <syntaxhighlight lang="xml">
<ContentView x:Name="containerName">
<ContentView.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference containerName}, Path=...}"
TargetType="ContentView"
Value="true">
<Setter Property="ControlTemplate"
Value="{StaticResource YourTemplate}" />
</DataTrigger>
...
</ContentView.Triggers>
</ContentView>
</syntaxhighlight>
|}
=== Remove HeadlessLayout style ===
'''This Style has no longer any effect in MAUI and even degrades app performance. We are keeping it in our standard UBIKThemes under the Obsolete section to maintain backward compatibility.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
<Style x:Key="HeadlessLayout" TargetType="Layout">
<Setter Property="CompressedLayout.IsHeadless" Value="{OnPlatform False, Android=True}" />
</Style>
</syntaxhighlight>
| Delete it from your custom UBIKThemes file
|}
=== Additional mandatory rule ===
'''In the customizings, however, it can and should be removed entirely, as it negatively affects performance, as mentioned before. To remove the style, you can simply use VS Code or any other editor with a search function and look through all custom .xaml files for usages of {StaticResource HeadlessLayout} or {DynamicResource HeadlessLayout}. These references should be removed from the respective elements or controls.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| <syntaxhighlight lang="xml">
<ContentView
Grid.Column="2"
ControlTemplate="{DynamicResource ChildCountBadge}"
HorizontalOptions="Start"
Style="{DynamicResource HeadlessLayout}"
VerticalOptions="Start" />
</syntaxhighlight>
| <syntaxhighlight lang="xml">
<ContentView
Grid.Column="2"
ControlTemplate="{DynamicResource ChildCountBadge}"
HorizontalOptions="Start"
VerticalOptions="Start" />
</syntaxhighlight>
|}
=== Rename SfPullToRefresh properties ===
'''Renamed in Maui, however, currently these properties cause an issue and should not be included in customizings.'''
SfPullToRefresh:
{| class="wikitable"
! Xamarin
! MAUI
|-
| RefreshContentHeight, RefreshContentWidth
| RefreshViewHeight, RefreshViewWidth
|}
=== Additional mandatory rule ===
'''Renamed in Maui.'''
{| class="wikitable"
! Xamarin
! MAUI
|-
| ProgressBackgroundColor, ProgressStrokeColor
| ProgressBackground, ProgressColor
|}
[[Category:How-To|Convert Xamarin XAMLs to Maui]]
[[Category:MAUI|Convert Xamarin XAMLs to Maui]]
[[Category:XAML|Convert Xamarin XAMLs to Maui]]
== SfTabView ==
== OnPlatform + OnIdiom backup ==