From 9b9c05773b2c3f95344627f39af342f9ca1c2d1e Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:45:10 +0800 Subject: [PATCH] fix: fix issues. --- .../Pages/ColorPickerDemo.axaml | 7 ++++++- .../Controls/ColorPicker.axaml | 16 ++++++++-------- .../Controls/ColorView.axaml | 16 ++++++++-------- .../Converters/ColorToTextConverter.cs | 9 +++++---- .../Converters/HsvColorToTextConverter.cs | 9 +++++---- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml index 65a3b2f..cb5dfaf 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml @@ -15,7 +15,7 @@ VerticalAlignment="Top" Orientation="Horizontal" Spacing="20"> - + @@ -23,9 +23,14 @@ VerticalAlignment="Top" Orientation="Horizontal"> + + + + diff --git a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml index c4a05e4..514af34 100644 --- a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml +++ b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml @@ -579,7 +579,7 @@ AutomationProperties.Name="Third Component" ColorComponent="{Binding #ColorSpectrum.ThirdComponent}" ColorModel="Hsva" - HsvColor="{Binding #ColorSpectrum.HsvColor}" + HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}" IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}" Orientation="Horizontal" /> @@ -591,7 +591,7 @@ AutomationProperties.Name="Alpha Component" ColorComponent="Alpha" ColorModel="Hsva" - HsvColor="{Binding #ColorSpectrum.HsvColor}" + HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}" IsEnabled="{TemplateBinding IsAlphaEnabled}" IsVisible="{TemplateBinding IsAlphaVisible}" IsRoundingEnabled="True" @@ -619,20 +619,20 @@ - + @@ -617,7 +617,7 @@ AutomationProperties.Name="Alpha Component" ColorComponent="Alpha" ColorModel="Hsva" - HsvColor="{Binding #ColorSpectrum.HsvColor}" + HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}" IsEnabled="{TemplateBinding IsAlphaEnabled}" IsVisible="{TemplateBinding IsAlphaVisible}" IsRoundingEnabled="True" @@ -645,20 +645,20 @@ - +