From 27b4e73f83c7f250a8808f11ce7d55b12eb85c67 Mon Sep 17 00:00:00 2001 From: Vit Nemecky Date: Tue, 26 May 2026 23:03:31 +0200 Subject: [PATCH] [MAUI] Resolve compiled XAML warning --- .../BrickController2/BrickController2.csproj | 1 + .../UI/Controls/DeviceChannelSelector.xaml | 4 +- .../BrickController2/UI/Controls/Dialogs.xaml | 2 +- .../UI/Controls/SettingsControl.xaml | 12 +- .../BrickController2/UI/Pages/AboutPage.xaml | 2 + .../UI/Pages/ChannelSetupPage.xaml | 2 + .../UI/Pages/ControllerActionPage.xaml | 2 + .../UI/Pages/ControllerProfilePage.xaml | 6 +- .../UI/Pages/CreationListPage.xaml | 5 +- .../UI/Pages/CreationPage.xaml | 5 +- .../UI/Pages/CreationSharePage.xaml | 6 +- .../UI/Pages/DeviceListPage.xaml | 5 +- .../BrickController2/UI/Pages/DevicePage.xaml | 6 +- .../UI/Pages/DeviceSettingsPage.xaml | 1 + .../UI/Pages/InputDeviceTesterPage.xaml | 5 +- .../UI/Pages/ManualDeviceListPage.xaml | 8 +- .../BrickController2/UI/Pages/PlayerPage.xaml | 4 +- .../UI/Pages/ScannerPageBase.xaml | 6 +- .../UI/Pages/SequenceEditorPage.xaml | 5 +- .../UI/Pages/SequenceListPage.xaml | 5 +- .../UI/Pages/SequenceSharePage.xaml | 6 +- .../UI/Pages/SettingsPage.xaml | 2 + .../ControllerProfilePageViewModel.cs | 87 +++++++------- .../UI/ViewModels/DeviceEntry.cs | 19 ++++ .../UI/ViewModels/DeviceGroup.cs | 18 +++ .../UI/ViewModels/DevicePageViewModel.cs | 107 +++++++++--------- .../ManualDeviceListPageViewModel.cs | 26 ----- 27 files changed, 208 insertions(+), 149 deletions(-) create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceEntry.cs create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceGroup.cs diff --git a/BrickController2/BrickController2/BrickController2.csproj b/BrickController2/BrickController2/BrickController2.csproj index 41f61ff83..1ba594d03 100644 --- a/BrickController2/BrickController2/BrickController2.csproj +++ b/BrickController2/BrickController2/BrickController2.csproj @@ -3,6 +3,7 @@ net10.0 BrickController2 + true diff --git a/BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml b/BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml index e54ccfbc9..0adbb20fd 100644 --- a/BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml +++ b/BrickController2/BrickController2/UI/Controls/DeviceChannelSelector.xaml @@ -5,7 +5,9 @@ xmlns:converters="clr-namespace:BrickController2.UI.Converters" xmlns:controls="clr-namespace:BrickController2.UI.Controls" xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" - x:Class="BrickController2.UI.Controls.DeviceChannelSelector"> + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" + x:Class="BrickController2.UI.Controls.DeviceChannelSelector" + x:DataType="viewModels:ControllerActionPageViewModel"> diff --git a/BrickController2/BrickController2/UI/Controls/Dialogs.xaml b/BrickController2/BrickController2/UI/Controls/Dialogs.xaml index 8a44190ce..75866ea1f 100644 --- a/BrickController2/BrickController2/UI/Controls/Dialogs.xaml +++ b/BrickController2/BrickController2/UI/Controls/Dialogs.xaml @@ -70,7 +70,7 @@ MinimumHeightRequest="40" MaximumHeightRequest="200"> - + diff --git a/BrickController2/BrickController2/UI/Controls/SettingsControl.xaml b/BrickController2/BrickController2/UI/Controls/SettingsControl.xaml index fec16fc33..e7b8fd63d 100644 --- a/BrickController2/BrickController2/UI/Controls/SettingsControl.xaml +++ b/BrickController2/BrickController2/UI/Controls/SettingsControl.xaml @@ -6,7 +6,9 @@ xmlns:converters="clr-namespace:BrickController2.UI.Converters" xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:t="clr-namespace:BrickController2.UI.Templates" + xmlns:settingsVm="clr-namespace:BrickController2.UI.ViewModels.Settings" x:Class="BrickController2.UI.Controls.SettingsControl" + x:DataType="settingsVm:SettingsPageViewModelBase" x:Name="Control" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -31,7 +33,7 @@ - + @@ -52,7 +54,7 @@ - + @@ -69,7 +71,7 @@ - + @@ -90,7 +92,7 @@ - + @@ -126,7 +128,7 @@ - + diff --git a/BrickController2/BrickController2/UI/Pages/AboutPage.xaml b/BrickController2/BrickController2/UI/Pages/AboutPage.xaml index aadbb30fe..2bf32d17a 100644 --- a/BrickController2/BrickController2/UI/Pages/AboutPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/AboutPage.xaml @@ -6,7 +6,9 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.AboutPage" + x:DataType="viewModels:AboutPageViewModel" Title="{extensions:Translate About}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> diff --git a/BrickController2/BrickController2/UI/Pages/ChannelSetupPage.xaml b/BrickController2/BrickController2/UI/Pages/ChannelSetupPage.xaml index 9ff51ec53..2afc507d7 100644 --- a/BrickController2/BrickController2/UI/Pages/ChannelSetupPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/ChannelSetupPage.xaml @@ -7,7 +7,9 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.ChannelSetupPage" + x:DataType="viewModels:ChannelSetupPageViewModel" Title="{extensions:Translate ChannelSetup}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> diff --git a/BrickController2/BrickController2/UI/Pages/ControllerActionPage.xaml b/BrickController2/BrickController2/UI/Pages/ControllerActionPage.xaml index 2d80a2ec3..9f3dcf41e 100644 --- a/BrickController2/BrickController2/UI/Pages/ControllerActionPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/ControllerActionPage.xaml @@ -9,7 +9,9 @@ xmlns:gameController="clr-namespace:BrickController2.PlatformServices.InputDevice" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.ControllerActionPage" + x:DataType="viewModels:ControllerActionPageViewModel" Title="{extensions:Translate ControllerAction}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> diff --git a/BrickController2/BrickController2/UI/Pages/ControllerProfilePage.xaml b/BrickController2/BrickController2/UI/Pages/ControllerProfilePage.xaml index 47118299a..effb0cfd6 100644 --- a/BrickController2/BrickController2/UI/Pages/ControllerProfilePage.xaml +++ b/BrickController2/BrickController2/UI/Pages/ControllerProfilePage.xaml @@ -7,8 +7,10 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.ControllerProfilePage" x:Name="Page" + x:DataType="viewModels:ControllerProfilePageViewModel" Title="{extensions:Translate ControllerProfile}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -49,7 +51,7 @@ - + @@ -79,7 +81,7 @@ - + diff --git a/BrickController2/BrickController2/UI/Pages/CreationListPage.xaml b/BrickController2/BrickController2/UI/Pages/CreationListPage.xaml index 0efc86532..39ac4e12e 100644 --- a/BrickController2/BrickController2/UI/Pages/CreationListPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/CreationListPage.xaml @@ -7,8 +7,11 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" + xmlns:models="clr-namespace:BrickController2.CreationManagement" x:Class="BrickController2.UI.Pages.CreationListPage" x:Name="Page" + x:DataType="viewModels:CreationListPageViewModel" Title="{extensions:Translate Creations}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -39,7 +42,7 @@ - + diff --git a/BrickController2/BrickController2/UI/Pages/CreationPage.xaml b/BrickController2/BrickController2/UI/Pages/CreationPage.xaml index 5cf82571e..d01a62254 100644 --- a/BrickController2/BrickController2/UI/Pages/CreationPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/CreationPage.xaml @@ -6,8 +6,11 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" + xmlns:models="clr-namespace:BrickController2.CreationManagement" x:Class="BrickController2.UI.Pages.CreationPage" x:Name="Page" + x:DataType="viewModels:CreationPageViewModel" Title="{extensions:Translate Creation}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -42,7 +45,7 @@ - + diff --git a/BrickController2/BrickController2/UI/Pages/CreationSharePage.xaml b/BrickController2/BrickController2/UI/Pages/CreationSharePage.xaml index db3ec5a6b..911c2d1ee 100644 --- a/BrickController2/BrickController2/UI/Pages/CreationSharePage.xaml +++ b/BrickController2/BrickController2/UI/Pages/CreationSharePage.xaml @@ -5,9 +5,11 @@ xmlns:controls="clr-namespace:BrickController2.UI.Controls" xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" - xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls" - x:Class="BrickController2.UI.Pages.CreationSharePage" + x:Class="BrickController2.UI.Pages.CreationSharePage" + x:DataType="viewModels:CreationSharePageViewModel" Title="{extensions:Translate Share}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> diff --git a/BrickController2/BrickController2/UI/Pages/DeviceListPage.xaml b/BrickController2/BrickController2/UI/Pages/DeviceListPage.xaml index 5e249380b..1dc88db7a 100644 --- a/BrickController2/BrickController2/UI/Pages/DeviceListPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/DeviceListPage.xaml @@ -7,8 +7,11 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" + xmlns:deviceManagement="clr-namespace:BrickController2.DeviceManagement" x:Class="BrickController2.UI.Pages.DeviceListPage" x:Name="Page" + x:DataType="viewModels:DeviceListPageViewModel" Title="{extensions:Translate Devices}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -26,7 +29,7 @@ - + diff --git a/BrickController2/BrickController2/UI/Pages/DevicePage.xaml b/BrickController2/BrickController2/UI/Pages/DevicePage.xaml index a65f72db9..c05ae1037 100644 --- a/BrickController2/BrickController2/UI/Pages/DevicePage.xaml +++ b/BrickController2/BrickController2/UI/Pages/DevicePage.xaml @@ -7,7 +7,9 @@ xmlns:extensions="clr-namespace:BrickController2.UI.MarkupExtensions" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:local="clr-namespace:BrickController2.UI.Pages" + xmlns:viewModels="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.DevicePage" + x:DataType="viewModels:DevicePageViewModel" Title="{extensions:Translate Device}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -114,7 +116,7 @@ - + @@ -125,7 +127,7 @@ + IsVisible="{Binding IsServoOrStepperSupported}"/> diff --git a/BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml b/BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml index a251de5b5..797b203e9 100644 --- a/BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml @@ -10,6 +10,7 @@ xmlns:vm="clr-namespace:BrickController2.UI.ViewModels" xmlns:t="clr-namespace:BrickController2.UI.Templates" x:Class="BrickController2.UI.Pages.DeviceSettingsPage" + x:DataType="vm:DeviceSettingsPageViewModel" Title="{extensions:Translate DeviceSettings}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> diff --git a/BrickController2/BrickController2/UI/Pages/InputDeviceTesterPage.xaml b/BrickController2/BrickController2/UI/Pages/InputDeviceTesterPage.xaml index 295667b94..13cf4ae2a 100644 --- a/BrickController2/BrickController2/UI/Pages/InputDeviceTesterPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/InputDeviceTesterPage.xaml @@ -8,6 +8,7 @@ xmlns:local="clr-namespace:BrickController2.UI.Pages" xmlns:vm="clr-namespace:BrickController2.UI.ViewModels" x:Class="BrickController2.UI.Pages.InputDeviceTesterPage" + x:DataType="vm:InputDeviceTesterPageViewModel" Title="{extensions:Translate InputDeviceTester}" ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> @@ -33,7 +34,7 @@ - +