File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed
components/ColorAnalyzer/samples/ContrastHelper Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 1- <UserControl x : Class =" ColorAnalyzerExperiment.Samples.ContrastOptionsPane"
1+ <UserControl x : Class =" ColorAnalyzerExperiment.Samples.ContrastOptionsPane"
22 xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
44 xmlns : controls =" using:CommunityToolkit.WinUI.Controls"
88 mc : Ignorable =" d" >
99
1010 <StackPanel Spacing =" 2" >
11- <StackPanel Orientation =" Horizontal" >
12- <StackPanel >
13- <TextBlock Text =" Desired Foreground" />
14- <controls : ColorPicker ColorChanged =" Foreground_ColorChanged"
15- IsColorChannelTextInputVisible =" True"
16- IsColorSliderVisible =" True"
17- Color =" White" />
18- </StackPanel >
19- <StackPanel >
20- <TextBlock Text =" Background" />
21- <controls : ColorPicker ColorChanged =" Background_ColorChanged"
22- IsColorChannelTextInputVisible =" True"
23- IsColorSliderVisible =" True"
24- Color =" Black" />
25- </StackPanel >
26- </StackPanel >
11+ <TextBlock Text =" Desired Foreground" />
12+ <controls : ColorPickerButton SelectedColor =" {x:Bind DesiredForeground, Mode=TwoWay}" />
13+
14+ <TextBlock Text =" Background" />
15+ <controls : ColorPickerButton SelectedColor =" {x:Bind DesiredBackground, Mode=TwoWay}" />
2716
2817 <Slider MinWidth =" 256"
2918 HorizontalAlignment =" Center"
Original file line number Diff line number Diff line change 55#if ! WINDOWS_UWP
66using Microsoft . UI . Xaml . Media . Imaging ;
77#elif WINDOWS_UWP
8+ using Windows . UI ;
89using Windows . UI . Xaml . Media . Imaging ;
910#endif
1011
@@ -19,10 +20,22 @@ public partial class ContrastOptionsPane : UserControl
1920 public ContrastOptionsPane ( ContrastHelperSampleBase sample )
2021 {
2122 _sample = sample ;
22-
23+
2324 this . InitializeComponent ( ) ;
2425 }
2526
27+ public Color DesiredForeground
28+ {
29+ get => _sample . DesiredForeground ;
30+ set => _sample . DesiredForeground = value ;
31+ }
32+
33+ public Color DesiredBackground
34+ {
35+ get => _sample . DesiredBackground ;
36+ set => _sample . DesiredBackground = value ;
37+ }
38+
2639 private void Foreground_ColorChanged ( MUXC . ColorPicker sender , MUXC . ColorChangedEventArgs args )
2740 {
2841 // TODO: Disect the colorpicker
You can’t perform that action at this time.
0 commit comments