From 97e0d397223a95e758b02d0254ea23a50b4e3fec Mon Sep 17 00:00:00 2001 From: Poker Date: Sat, 21 Dec 2024 11:43:29 +0800 Subject: [PATCH 1/6] Fix: ColorPicker Binding failed (#579) * fix ColorPicker Binding failed * Apply suggestions from code review * Update components/ColorPicker/src/Converters/NullToTransparentConverter.cs --------- Co-authored-by: Arlo Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com> --- components/ColorPicker/src/ColorPicker.xaml | 5 +++-- .../Converters/NullToTransparentConverter.cs | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 components/ColorPicker/src/Converters/NullToTransparentConverter.cs diff --git a/components/ColorPicker/src/ColorPicker.xaml b/components/ColorPicker/src/ColorPicker.xaml index 284eb7b2..557f6ab0 100644 --- a/components/ColorPicker/src/ColorPicker.xaml +++ b/components/ColorPicker/src/ColorPicker.xaml @@ -1,4 +1,4 @@ - + @@ -291,7 +292,7 @@ animations:Implicit.HideAnimations="{StaticResource HideTransitions}" animations:Implicit.ShowAnimations="{StaticResource ShowTransitions}" ItemsSource="{TemplateBinding CustomPaletteColors}" - SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Mode=TwoWay}" + SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Converter={StaticResource NullToTransparentConverter}, Mode=TwoWay}" SelectionMode="Single" Tag="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Mode=OneWay}"> diff --git a/components/ColorPicker/src/Converters/NullToTransparentConverter.cs b/components/ColorPicker/src/Converters/NullToTransparentConverter.cs new file mode 100644 index 00000000..1d33c538 --- /dev/null +++ b/components/ColorPicker/src/Converters/NullToTransparentConverter.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace CommunityToolkit.WinUI.Controls; + +/// +/// Value converter that converts null values to Transparent. +/// +public partial class NullToTransparentConverter : IValueConverter +{ + /// + public object Convert(object value, Type targetType, object parameter, string language) => value; + + /// + public object ConvertBack(object? value, Type targetType, object parameter, string language) => value ?? +#if WINUI2 + Windows.UI.Colors.Transparent; +#else + Microsoft.UI.Colors.Transparent; +#endif +} From 3ead340530457afb7809ed2eb32e95796fa98de5 Mon Sep 17 00:00:00 2001 From: Arlo Date: Mon, 23 Dec 2024 12:59:51 -0600 Subject: [PATCH 2/6] Refactor MultiTarget, fix consuming uwp from net9.0-windows --- tooling | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling b/tooling index ec68ac62..5a12e3de 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit ec68ac62588110f3a813131de962d832866bf0d8 +Subproject commit 5a12e3de2d2c466f11e0f5251e493d52fb82106f From 386a7f19ca18505bb8ca44efd544a93f71f6aba9 Mon Sep 17 00:00:00 2001 From: Arlo Date: Mon, 23 Dec 2024 13:05:10 -0600 Subject: [PATCH 3/6] Use tooling for GlobalUsings imports --- Windows.Toolkit.Common.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Windows.Toolkit.Common.props b/Windows.Toolkit.Common.props index 8853b027..207061c1 100644 --- a/Windows.Toolkit.Common.props +++ b/Windows.Toolkit.Common.props @@ -29,8 +29,4 @@ true true - - - - From 03feb184f458fc463f2ad0452a45f05364b3fb8f Mon Sep 17 00:00:00 2001 From: Arlo Date: Mon, 23 Dec 2024 18:52:12 -0600 Subject: [PATCH 4/6] Fixed an issue where ExcludeMultiTargets wasn't working as expected --- tooling | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling b/tooling index 5a12e3de..eb7c4426 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit 5a12e3de2d2c466f11e0f5251e493d52fb82106f +Subproject commit eb7c4426ef1bcaabad255fd6463057b75befad34 From a77ede5f7c9ce7fc2dfe55034da34dcd2d84cfd2 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 25 Dec 2024 19:11:55 +0100 Subject: [PATCH 5/6] Bump Win2D dependencies --- components/ImageCropper/src/Dependencies.props | 4 ++-- components/Media/src/Dependencies.props | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/ImageCropper/src/Dependencies.props b/components/ImageCropper/src/Dependencies.props index d46a2f3a..682bbcdd 100644 --- a/components/ImageCropper/src/Dependencies.props +++ b/components/ImageCropper/src/Dependencies.props @@ -11,7 +11,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/components/Media/src/Dependencies.props b/components/Media/src/Dependencies.props index fad06d5e..7b27ab73 100644 --- a/components/Media/src/Dependencies.props +++ b/components/Media/src/Dependencies.props @@ -1,5 +1,5 @@ - - + + + + - + From dba23225638957d8d07f1f0f728083104de68c33 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 26 Dec 2024 02:40:28 +0100 Subject: [PATCH 6/6] Bump tooling pointer --- tooling | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling b/tooling index eb7c4426..93931e0b 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit eb7c4426ef1bcaabad255fd6463057b75befad34 +Subproject commit 93931e0beda3520fcc68e8bf9975a4ebb7067674