From 06a4ad8285776fbf449a0e75042ccc31297a69d6 Mon Sep 17 00:00:00 2001 From: roubachof Date: Thu, 23 Jun 2022 17:13:23 +0200 Subject: [PATCH] fix maui sample --- .../ExceptionToImageSourceConverter.cs | 10 +- Retronado.Maui/Views/CommandsPage.xaml | 263 +++++++++++------- .../Sharpnado.Maui.TaskLoaderView.csproj | 20 +- .../Sharpnado.TaskLoaderView.csproj | 57 +--- 4 files changed, 182 insertions(+), 168 deletions(-) diff --git a/Retronado.Maui/ExceptionToImageSourceConverter.cs b/Retronado.Maui/ExceptionToImageSourceConverter.cs index 9b0b062..003564d 100644 --- a/Retronado.Maui/ExceptionToImageSourceConverter.cs +++ b/Retronado.Maui/ExceptionToImageSourceConverter.cs @@ -8,7 +8,7 @@ namespace Sample.Converters { - public class ExceptionToImageSourceConverter : IValueConverter + public class ExceptionToImageSourceConverter : IValueConverter, IMarkupExtension { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { @@ -32,7 +32,6 @@ public object Convert(object value, Type targetType, object parameter, CultureIn break; } - return ImageSource.FromFile(imageName); } @@ -41,5 +40,10 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu // One-Way converter only throw new NotImplementedException(); } + + public object ProvideValue(IServiceProvider serviceProvider) + { + return this; + } } -} \ No newline at end of file +} diff --git a/Retronado.Maui/Views/CommandsPage.xaml b/Retronado.Maui/Views/CommandsPage.xaml index cd8726c..d76fee3 100644 --- a/Retronado.Maui/Views/CommandsPage.xaml +++ b/Retronado.Maui/Views/CommandsPage.xaml @@ -8,27 +8,12 @@ xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" xmlns:tlv="clr-namespace:Sharpnado.TaskLoaderView;assembly=Sharpnado.Maui.TaskLoaderView" xmlns:loc="clr-namespace:Sample.Localization" + xmlns:converters="clr-namespace:Sample.Converters" ios:Page.UseSafeArea="true" BackgroundColor="{StaticResource TopElementBackground}" x:DataType="viewModels:CommandsPageViewModel" NavigationPage.HasNavigationBar="false"> - - - - - - @@ -41,86 +26,154 @@ BackgroundColor="{StaticResource TopElementBackground}" Theme="Standard" /> - - - - - - - - - -