From d083d34e404aebf39ee2adae0cd5203ae11e96f1 Mon Sep 17 00:00:00 2001 From: Ariel De Los Santos Date: Wed, 11 Oct 2023 17:09:35 -0400 Subject: [PATCH] fix(converters): refactor converters to take type of visibility instead of string --- .../Styles/Application/Common/Converters.xaml | 39 ++++++++++--------- .../Styles/Controls/v2/ComboBox.xaml | 10 +++-- .../Uno.Themes.Samples.Shared/Converters.xaml | 15 ++++--- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/library/Uno.Material/Styles/Application/Common/Converters.xaml b/src/library/Uno.Material/Styles/Application/Common/Converters.xaml index 2c3b90773..f227084ad 100644 --- a/src/library/Uno.Material/Styles/Application/Common/Converters.xaml +++ b/src/library/Uno.Material/Styles/Application/Common/Converters.xaml @@ -2,15 +2,18 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:um="using:Uno.Material"> + Visible + Collapsed + + TrueValue="{StaticResource VisibleVal}" + FalseValue="{StaticResource CollapsedVal}" + NullValue="{StaticResource CollapsedVal}" /> + TrueValue="{StaticResource CollapsedVal}" + FalseValue="{StaticResource VisibleVal}" + NullValue="{StaticResource VisibleVal}" /> + NotNullOrEmptyValue="{StaticResource CollapsedVal}" + NullOrEmptyValue="{StaticResource VisibleVal}" /> + NotNullOrEmptyValue="{StaticResource VisibleVal}" + NullOrEmptyValue="{StaticResource CollapsedVal}" /> + NotNullValue="{StaticResource VisibleVal}" + NullValue="{StaticResource CollapsedVal}" /> + NotNullValue="{StaticResource VisibleVal}" + NullValue="{StaticResource CollapsedVal}" /> + NotEmptyOrNullValue="{StaticResource CollapsedVal}" + EmptyOrNullValue="{StaticResource VisibleVal}" /> + NotEmptyOrNullValue="{StaticResource VisibleVal}" + EmptyOrNullValue="{StaticResource CollapsedVal}" /> diff --git a/src/library/Uno.Material/Styles/Controls/v2/ComboBox.xaml b/src/library/Uno.Material/Styles/Controls/v2/ComboBox.xaml index 36b08be66..237dcfb2e 100644 --- a/src/library/Uno.Material/Styles/Controls/v2/ComboBox.xaml +++ b/src/library/Uno.Material/Styles/Controls/v2/ComboBox.xaml @@ -5,6 +5,8 @@ xmlns:um="using:Uno.Material" xmlns:xamarin="http://uno.ui/xamarin" mc:Ignorable="xamarin"> + Visible + Collapsed + NotNullValue="{StaticResource CollapsedVal}" + NullValue="{StaticResource VisibleVal}" /> + NotNullValue="{StaticResource VisibleVal}" + NullValue="{StaticResource CollapsedVal}" /> diff --git a/src/samples/UWP/Uno.Themes.Samples.Shared/Converters.xaml b/src/samples/UWP/Uno.Themes.Samples.Shared/Converters.xaml index 48c5d9bc7..4ee98f12c 100644 --- a/src/samples/UWP/Uno.Themes.Samples.Shared/Converters.xaml +++ b/src/samples/UWP/Uno.Themes.Samples.Shared/Converters.xaml @@ -1,18 +1,21 @@  + Visible + Collapsed + + TrueValue="{StaticResource CollapsedVal}" + FalseValue="{StaticResource VisibleVal}" /> + TrueValue="{StaticResource VisibleVal}" + FalseValue="{StaticResource CollapsedVal}" /> + TrueValue="{StaticResource VisibleVal}" + NullOrFalseValue="{StaticResource CollapsedVal}" />