diff options
author | Bertrand Le Roy <beleroy@microsoft.com> | 2017-10-31 01:41:23 +0300 |
---|---|---|
committer | Bertrand Le Roy <beleroy@microsoft.com> | 2017-11-04 02:35:45 +0300 |
commit | c60750205216c8b410f70da6a05207f7e639e6bb (patch) | |
tree | 42371f43726ec0d7221a34f534f4532be749f39f | |
parent | 37e0c812a3868a617adc72c8999de09b82d9255e (diff) |
Make color picker localizable
5 files changed, 607 insertions, 81 deletions
diff --git a/Xamarin.PropertyEditing.Windows/ColorComponentsEditorControl.cs b/Xamarin.PropertyEditing.Windows/ColorComponentsEditorControl.cs index 3db2608..588d113 100644 --- a/Xamarin.PropertyEditing.Windows/ColorComponentsEditorControl.cs +++ b/Xamarin.PropertyEditing.Windows/ColorComponentsEditorControl.cs @@ -161,7 +161,10 @@ namespace Xamarin.PropertyEditing.Windows if (ContextMenu != null) { foreach (MenuItem item in ContextMenu.Items) { item.Click += (s, e) => { - ColorComponentModel = (ColorComponentModel)Enum.Parse (typeof (ColorComponentModel), item.Header.ToString ()); + ColorComponentModel = (ColorComponentModel)Enum.Parse ( + typeof (ColorComponentModel), + item.Name.Substring(0, item.Name.Length - "MenuItem".Length), + true); }; CheckIfCurrentModel (item); } @@ -259,7 +262,7 @@ namespace Xamarin.PropertyEditing.Windows } } - private static void OnColorModelChanged (DependencyObject d, DependencyPropertyChangedEventArgs e) + static void OnColorModelChanged (DependencyObject d, DependencyPropertyChangedEventArgs e) { var that = d as ColorComponentsEditorControl; @@ -276,7 +279,7 @@ namespace Xamarin.PropertyEditing.Windows UpdateVisibility (that.hsbPane, ColorComponentModel.HSB); } - private void CheckIfCurrentModel (MenuItem item) + void CheckIfCurrentModel (MenuItem item) { item.IsChecked = item.Header.ToString () == Enum.GetName (typeof (ColorComponentModel), ColorComponentModel); } diff --git a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml index 6f7d7cb..558c2a2 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml @@ -340,7 +340,7 @@ <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <ComboBox Name="colorSpacePicker" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding ColorSpaces}" - SelectedItem="{Binding Value.ColorSpace, Mode=OneTime}" VerticalContentAlignment="Center" AutomationProperties.HelpText="Color space" /> + SelectedItem="{Binding Value.ColorSpace, Mode=OneTime}" VerticalContentAlignment="Center" AutomationProperties.HelpText="{x:Static prop:Resources.ColorSpace}" ToolTip="{x:Static prop:Resources.ColorSpace}"/> <Grid Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Grid.RowDefinitions> <RowDefinition Height="*"/> @@ -453,10 +453,10 @@ <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu Placement="Bottom"> - <MenuItem Header="HLS"/> - <MenuItem Header="HSB"/> - <MenuItem Header="RGB"/> - <MenuItem Header="CMYK"/> + <MenuItem Name="hlsMenuItem" Header="{x:Static prop:Resources.HLS}" ToolTip="{x:Static prop:Resources.HueLightnessSaturation}" AutomationProperties.HelpText="{x:Static prop:Resources.HueLightnessSaturation}"/> + <MenuItem Name="hsbMenuItem" Header="{x:Static prop:Resources.HSB}" ToolTip="{x:Static prop:Resources.HueSaturationBrightness}" AutomationProperties.HelpText="{x:Static prop:Resources.HueSaturationBrightness}"/> + <MenuItem Name="rgbMenuItem" Header="{x:Static prop:Resources.RGB}" ToolTip="{x:Static prop:Resources.RedGreenBlue}" AutomationProperties.HelpText="{x:Static prop:Resources.RedGreenBlue}"/> + <MenuItem Name="cmykMenuItem" Header="{x:Static prop:Resources.CMYK}" ToolTip="{x:Static prop:Resources.CyanMagentaYellowBlack}" AutomationProperties.HelpText="{x:Static prop:Resources.CyanMagentaYellowBlack}"/> </ContextMenu> </Setter.Value> </Setter> @@ -468,6 +468,7 @@ <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> + <Grid x:Name="hlsPane" Visibility="Collapsed" Grid.Row="0" Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="22"/> @@ -479,13 +480,15 @@ <ColumnDefinition Width="23"/> <ColumnDefinition Width="77"/> </Grid.ColumnDefinitions> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + ToolTip="{x:Static prop:Resources.Hue}" AutomationProperties.HelpText="{x:Static prop:Resources.Hue}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">H</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.HueInitial}"/> </Label> - <local:ColorComponentBox x:Name="hueEntry" - AutomationProperties.HelpText="Hue" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" - Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Hue, Mode=TwoWay, Converter={local:DoubleToDegreesConverter}}"> + <local:ColorComponentBox x:Name="hueEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + AutomationProperties.HelpText="{x:Static prop:Resources.Hue}" ToolTip="{x:Static prop:Resources.Hue}" + Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Hue, Mode=TwoWay, Converter={local:DoubleToDegreesConverter}}"> <local:ColorComponentBox.GradientBrush> <LinearGradientBrush EndPoint="1,0" StartPoint="0,0"> <GradientStop Color="Red" Offset="0"/> @@ -498,28 +501,36 @@ </LinearGradientBrush> </local:ColorComponentBox.GradientBrush> </local:ColorComponentBox> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + ToolTip="{x:Static prop:Resources.Lightness}" AutomationProperties.HelpText="{x:Static prop:Resources.Lightness}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">L</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.LightnessInitial}"/> </Label> <local:ColorComponentBox x:Name="lightnessEntry" - AutomationProperties.HelpText="Lightness" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" - Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Lightness, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" - GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToLightnessBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + AutomationProperties.HelpText="{x:Static prop:Resources.Lightness}" ToolTip="{x:Static prop:Resources.Lightness}" + HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Lightness, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" + GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToLightnessBrushConverter}}"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Saturation}" ToolTip="{x:Static prop:Resources.Saturation}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">S</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.SaturationInitial}"/> </Label> - <local:ColorComponentBox x:Name="saturationEntryHLS" - AutomationProperties.HelpText="Saturation" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + <local:ColorComponentBox x:Name="saturationEntryHLS" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + AutomationProperties.HelpText="{x:Static prop:Resources.Saturation}" ToolTip="{x:Static prop:Resources.Saturation}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Saturation, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToSaturationBrushConverter}}"/> - <Label Content="A" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" /> - <local:ColorComponentBox x:Name="alphaEntryHLS" - AutomationProperties.HelpText="Alpha" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + + <Label Content="{x:Static prop:Resources.AlphaInitial}" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}"/> + <local:ColorComponentBox x:Name="alphaEntryHLS" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=A, Converter={local:ByteToPercentageConverter}, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToAlphaBrushConverter}}"/> </Grid> + <Grid x:Name="hsbPane" Visibility="Collapsed" Grid.Row="0" Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="22"/> @@ -531,12 +542,14 @@ <ColumnDefinition Width="23"/> <ColumnDefinition Width="77"/> </Grid.ColumnDefinitions> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Hue}" ToolTip="{x:Static prop:Resources.Hue}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">H</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.HueInitial}"/> </Label> - <local:ColorComponentBox x:Name="hsbHueEntry" - AutomationProperties.HelpText="Hue" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + <local:ColorComponentBox x:Name="hsbHueEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + AutomationProperties.HelpText="{x:Static prop:Resources.Hue}" ToolTip="{x:Static prop:Resources.Hue}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Hue, Mode=TwoWay, Converter={local:DoubleToDegreesConverter}}"> <local:ColorComponentBox.GradientBrush> <LinearGradientBrush EndPoint="1,0" StartPoint="0,0"> @@ -550,28 +563,35 @@ </LinearGradientBrush> </local:ColorComponentBox.GradientBrush> </local:ColorComponentBox> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Saturation}" ToolTip="{x:Static prop:Resources.Saturation}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">S</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.SaturationInitial}"/> </Label> - <local:ColorComponentBox x:Name="saturationEntryHSB" - AutomationProperties.HelpText="Saturation" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + <local:ColorComponentBox x:Name="saturationEntryHSB" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + AutomationProperties.HelpText="{x:Static prop:Resources.Saturation}" ToolTip="{x:Static prop:Resources.Saturation}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Saturation, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToSaturationBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Brightness}" ToolTip="{x:Static prop:Resources.Brightness}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">B</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.BrightnessInitial}"/> </Label> - <local:ColorComponentBox x:Name="brightnessEntry" - AutomationProperties.HelpText="Brightness" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + <local:ColorComponentBox x:Name="brightnessEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + AutomationProperties.HelpText="{x:Static prop:Resources.Brightness}" ToolTip="{x:Static prop:Resources.Brightness}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Brightness, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToBrightnessBrushConverter}}"/> - <Label Content="A" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" /> - <local:ColorComponentBox x:Name="alphaEntryHSB" - AutomationProperties.HelpText="Alpha" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + + <Label Content="{x:Static prop:Resources.AlphaInitial}" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}"/> + <local:ColorComponentBox x:Name="alphaEntryHSB" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=A, Converter={local:ByteToPercentageConverter}, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToAlphaBrushConverter}}"/> </Grid> + <Grid x:Name="rgbPane" Grid.Row="0" Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="22"/> @@ -583,36 +603,45 @@ <ColumnDefinition Width="23"/> <ColumnDefinition Width="77"/> </Grid.ColumnDefinitions> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Red}" ToolTip="{x:Static prop:Resources.Red}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">R</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.RedInitial}"/> </Label> - <local:ColorComponentBox x:Name="redEntry" - AutomationProperties.HelpText="Red" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + <local:ColorComponentBox x:Name="redEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + AutomationProperties.HelpText="{x:Static prop:Resources.Red}" ToolTip="{x:Static prop:Resources.Red}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=R, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToRedBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Green}" ToolTip="{x:Static prop:Resources.Green}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">G</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.GreenInitial}"/> </Label> - <local:ColorComponentBox x:Name="greenEntry" - AutomationProperties.HelpText="Green" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + <local:ColorComponentBox x:Name="greenEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + AutomationProperties.HelpText="{x:Static prop:Resources.Green}" ToolTip="{x:Static prop:Resources.Green}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=G, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToGreenBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Blue}" ToolTip="{x:Static prop:Resources.Blue}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">B</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.BlueInitial}"/> </Label> - <local:ColorComponentBox x:Name="blueEntry" - AutomationProperties.HelpText="Blue" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + <local:ColorComponentBox x:Name="blueEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + AutomationProperties.HelpText="{x:Static prop:Resources.Blue}" ToolTip="{x:Static prop:Resources.Blue}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=B, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToBlueBrushConverter}}"/> - <Label Content="A" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" /> - <local:ColorComponentBox x:Name="alphaEntryRGB" - AutomationProperties.HelpText="Alpha" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + + <Label Content="{x:Static prop:Resources.AlphaInitial}" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}"/> + <local:ColorComponentBox x:Name="alphaEntryRGB" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=A, Converter={local:ByteToPercentageConverter}, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToAlphaBrushConverter}}"/> </Grid> + <Grid x:Name="cmykPane" Visibility="Collapsed" Grid.Row="0" Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="22"/> @@ -625,47 +654,57 @@ <ColumnDefinition Width="23"/> <ColumnDefinition Width="77"/> </Grid.ColumnDefinitions> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Cyan}" ToolTip="{x:Static prop:Resources.Cyan}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">C</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.CyanInitial}"/> </Label> - <local:ColorComponentBox x:Name="cyanEntry" - AutomationProperties.HelpText="Cyan" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + <local:ColorComponentBox x:Name="cyanEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" + AutomationProperties.HelpText="{x:Static prop:Resources.Cyan}" ToolTip="{x:Static prop:Resources.Cyan}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=C, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToCyanBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Magenta}" ToolTip="{x:Static prop:Resources.Magenta}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">M</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.MagentaInitial}"/> </Label> - <local:ColorComponentBox x:Name="magentaEntry" - AutomationProperties.HelpText="Magenta" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + <local:ColorComponentBox x:Name="magentaEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" + AutomationProperties.HelpText="{x:Static prop:Resources.Magenta}" ToolTip="{x:Static prop:Resources.Magenta}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=M, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToMagentaBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Yellow}" ToolTip="{x:Static prop:Resources.Yellow}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">Y</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.YellowInitial}"/> </Label> - <local:ColorComponentBox x:Name="yellowEntry" - AutomationProperties.HelpText="Yellow" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + <local:ColorComponentBox x:Name="yellowEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" + AutomationProperties.HelpText="{x:Static prop:Resources.Yellow}" ToolTip="{x:Static prop:Resources.Yellow}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Y, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToYellowBrushConverter}}"/> - <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="3" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False"/> + + <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="3" Opacity="0" FocusVisualStyle="{x:Null}" Panel.ZIndex="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.Black}" ToolTip="{x:Static prop:Resources.Black}"/> <Label HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" Margin="3,0,0,0"> - <TextBlock TextDecorations="Underline">K</TextBlock> + <TextBlock TextDecorations="Underline" Text="{x:Static prop:Resources.BlackInitial}"/> </Label> - <local:ColorComponentBox x:Name="blackEntry" - AutomationProperties.HelpText="Black" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + <local:ColorComponentBox x:Name="blackEntry" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" + AutomationProperties.HelpText="{x:Static prop:Resources.Black}" ToolTip="{x:Static prop:Resources.Black}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=K, Mode=TwoWay, Converter={local:DoubleToPercentageConverter}}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToBlackBrushConverter}}"/> - <Label Content="A" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" /> - <local:ColorComponentBox x:Name="alphaEntryCMYK" - AutomationProperties.HelpText="Alpha" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="4" + + <Label Content="{x:Static prop:Resources.AlphaInitial}" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}"/> + <local:ColorComponentBox x:Name="alphaEntryCMYK" HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Column="1" Grid.Row="4" + AutomationProperties.HelpText="{x:Static prop:Resources.Alpha}" ToolTip="{x:Static prop:Resources.Alpha}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=A, Converter={local:ByteToPercentageConverter}, Mode=TwoWay}" GradientBrush="{TemplateBinding Color, Converter={local:ColorComponentToAlphaBrushConverter}}"/> </Grid> - <TextBox Name="hexEntry" Margin="2,0,2,0" - AutomationProperties.HelpText="Hex value" HorizontalAlignment="Right" VerticalAlignment="Bottom" - Grid.Column="0" Grid.Row="2" + + <TextBox Name="hexEntry" Margin="2,0,2,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="0" Grid.Row="2" + AutomationProperties.HelpText="{x:Static prop:Resources.HexValue}" ToolTip="{x:Static prop:Resources.HexValue}" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Converter={local:HexColorConverter}, Mode=TwoWay}"/> </Grid> </ControlTemplate> @@ -730,13 +769,16 @@ <SolidColorBrush Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InitialColor, Converter={local:CommonColorToColorConverter}}"/> </local:BrushBoxControl.Brush> </local:BrushBoxControl> - <Button x:Name="initialColorButton" HorizontalAlignment="Stretch" Grid.Column="0" Panel.ZIndex="1" Opacity="0" FocusVisualStyle="{x:Null}" ToolTip="Initial color" IsTabStop="False"/> - <local:BrushBoxControl HorizontalAlignment="Stretch" Grid.Column="1" ToolTip="Current color" IsTabStop="False"> + <Button x:Name="initialColorButton" HorizontalAlignment="Stretch" Grid.Column="0" Panel.ZIndex="1" Opacity="0" FocusVisualStyle="{x:Null}" + AutomationProperties.HelpText="{x:Static prop:Resources.InitialColor}" ToolTip="{x:Static prop:Resources.InitialColor}" IsTabStop="False"/> + <local:BrushBoxControl HorizontalAlignment="Stretch" Grid.Column="1" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.CurrentColor}" ToolTip="{x:Static prop:Resources.CurrentColor}"> <local:BrushBoxControl.Brush> <SolidColorBrush Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Color, Converter={local:CommonColorToColorConverter}}"/> </local:BrushBoxControl.Brush> </local:BrushBoxControl> - <local:BrushBoxControl HorizontalAlignment="Stretch" Grid.Column="2" ToolTip="Last color" Margin="1,0,0,0" IsTabStop="False"> + <local:BrushBoxControl HorizontalAlignment="Stretch" Grid.Column="2" Margin="1,0,0,0" IsTabStop="False" + AutomationProperties.HelpText="{x:Static prop:Resources.LastColor}" ToolTip="{x:Static prop:Resources.LastColor}"> <local:BrushBoxControl.Brush> <SolidColorBrush Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=LastColor, Converter={local:CommonColorToColorConverter}}"/> </local:BrushBoxControl.Brush> diff --git a/Xamarin.PropertyEditing/Properties/Resources.Designer.cs b/Xamarin.PropertyEditing/Properties/Resources.Designer.cs index b2b8eb0..7afa4ee 100644 --- a/Xamarin.PropertyEditing/Properties/Resources.Designer.cs +++ b/Xamarin.PropertyEditing/Properties/Resources.Designer.cs @@ -61,6 +61,132 @@ namespace Xamarin.PropertyEditing.Properties { } /// <summary> + /// Looks up a localized string similar to Alpha. + /// </summary> + public static string Alpha { + get { + return ResourceManager.GetString("Alpha", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to A. + /// </summary> + public static string AlphaInitial { + get { + return ResourceManager.GetString("AlphaInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Black. + /// </summary> + public static string Black { + get { + return ResourceManager.GetString("Black", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to K. + /// </summary> + public static string BlackInitial { + get { + return ResourceManager.GetString("BlackInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Blue. + /// </summary> + public static string Blue { + get { + return ResourceManager.GetString("Blue", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to B. + /// </summary> + public static string BlueInitial { + get { + return ResourceManager.GetString("BlueInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Brightness. + /// </summary> + public static string Brightness { + get { + return ResourceManager.GetString("Brightness", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to B. + /// </summary> + public static string BrightnessInitial { + get { + return ResourceManager.GetString("BrightnessInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to CMYK. + /// </summary> + public static string CMYK { + get { + return ResourceManager.GetString("CMYK", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Color space. + /// </summary> + public static string ColorSpace { + get { + return ResourceManager.GetString("ColorSpace", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Current color. + /// </summary> + public static string CurrentColor { + get { + return ResourceManager.GetString("CurrentColor", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Cyan. + /// </summary> + public static string Cyan { + get { + return ResourceManager.GetString("Cyan", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to C. + /// </summary> + public static string CyanInitial { + get { + return ResourceManager.GetString("CyanInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Cyan / Magenta / Yellow / Black. + /// </summary> + public static string CyanMagentaYellowBlack { + get { + return ResourceManager.GetString("CyanMagentaYellowBlack", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Event handlers for the selected element. /// </summary> public static string EventHandlersSelectedElement { @@ -79,6 +205,141 @@ namespace Xamarin.PropertyEditing.Properties { } /// <summary> + /// Looks up a localized string similar to Green. + /// </summary> + public static string Green { + get { + return ResourceManager.GetString("Green", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to G. + /// </summary> + public static string GreenInitial { + get { + return ResourceManager.GetString("GreenInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Hex value. + /// </summary> + public static string HexValue { + get { + return ResourceManager.GetString("HexValue", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to HLS. + /// </summary> + public static string HLS { + get { + return ResourceManager.GetString("HLS", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to HSB. + /// </summary> + public static string HSB { + get { + return ResourceManager.GetString("HSB", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Hue. + /// </summary> + public static string Hue { + get { + return ResourceManager.GetString("Hue", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to H. + /// </summary> + public static string HueInitial { + get { + return ResourceManager.GetString("HueInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Hue / Lightness / Saturation. + /// </summary> + public static string HueLightnessSaturation { + get { + return ResourceManager.GetString("HueLightnessSaturation", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Hue / Saturation / Brightness. + /// </summary> + public static string HueSaturationBrightness { + get { + return ResourceManager.GetString("HueSaturationBrightness", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Initial color. + /// </summary> + public static string InitialColor { + get { + return ResourceManager.GetString("InitialColor", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Last color. + /// </summary> + public static string LastColor { + get { + return ResourceManager.GetString("LastColor", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Lightness. + /// </summary> + public static string Lightness { + get { + return ResourceManager.GetString("Lightness", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to L. + /// </summary> + public static string LightnessInitial { + get { + return ResourceManager.GetString("LightnessInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Magenta. + /// </summary> + public static string Magenta { + get { + return ResourceManager.GetString("Magenta", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to M. + /// </summary> + public static string MagentaInitial { + get { + return ResourceManager.GetString("MagentaInitial", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to {0} objects selected. /// </summary> public static string MultipleObjectsSelected { @@ -133,6 +394,60 @@ namespace Xamarin.PropertyEditing.Properties { } /// <summary> + /// Looks up a localized string similar to Red. + /// </summary> + public static string Red { + get { + return ResourceManager.GetString("Red", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Red / Green/ Blue. + /// </summary> + public static string RedGreenBlue { + get { + return ResourceManager.GetString("RedGreenBlue", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to R. + /// </summary> + public static string RedInitial { + get { + return ResourceManager.GetString("RedInitial", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to RGB. + /// </summary> + public static string RGB { + get { + return ResourceManager.GetString("RGB", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Saturation. + /// </summary> + public static string Saturation { + get { + return ResourceManager.GetString("Saturation", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to S. + /// </summary> + public static string SaturationInitial { + get { + return ResourceManager.GetString("SaturationInitial", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Type. /// </summary> public static string Type { @@ -149,5 +464,23 @@ namespace Xamarin.PropertyEditing.Properties { return ResourceManager.GetString("ViewPropertiesOrEvents", resourceCulture); } } + + /// <summary> + /// Looks up a localized string similar to Yellow. + /// </summary> + public static string Yellow { + get { + return ResourceManager.GetString("Yellow", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Y. + /// </summary> + public static string YellowInitial { + get { + return ResourceManager.GetString("YellowInitial", resourceCulture); + } + } } } diff --git a/Xamarin.PropertyEditing/Properties/Resources.resx b/Xamarin.PropertyEditing/Properties/Resources.resx index a8af4e4..509c8b8 100644 --- a/Xamarin.PropertyEditing/Properties/Resources.resx +++ b/Xamarin.PropertyEditing/Properties/Resources.resx @@ -117,12 +117,128 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <data name="Alpha" xml:space="preserve"> + <value>Alpha</value> + <comment>Alpha textbox help text</comment> + </data> + <data name="AlphaInitial" xml:space="preserve"> + <value>A</value> + <comment>Alpha initial used as alpha textbox label</comment> + </data> + <data name="Black" xml:space="preserve"> + <value>Black</value> + <comment>Black textbox help text</comment> + </data> + <data name="BlackInitial" xml:space="preserve"> + <value>K</value> + <comment>Black initial used as black textbox label</comment> + </data> + <data name="Blue" xml:space="preserve"> + <value>Blue</value> + <comment>Blue textbox help text</comment> + </data> + <data name="BlueInitial" xml:space="preserve"> + <value>B</value> + <comment>Blue initial used as blue textbox label</comment> + </data> + <data name="Brightness" xml:space="preserve"> + <value>Brightness</value> + <comment>Brightness textbox help text</comment> + </data> + <data name="BrightnessInitial" xml:space="preserve"> + <value>B</value> + <comment>Brightness initial used as brightness textbox label</comment> + </data> + <data name="CMYK" xml:space="preserve"> + <value>CMYK</value> + <comment>Cyan magenta yellow black menu entry</comment> + </data> + <data name="ColorSpace" xml:space="preserve"> + <value>Color space</value> + <comment>Color space dropdown help text</comment> + </data> + <data name="CurrentColor" xml:space="preserve"> + <value>Current color</value> + <comment>Current color help text</comment> + </data> + <data name="Cyan" xml:space="preserve"> + <value>Cyan</value> + <comment>Cyan textbox help text</comment> + </data> + <data name="CyanInitial" xml:space="preserve"> + <value>C</value> + <comment>Cyan initial used as cyan textbox label</comment> + </data> + <data name="CyanMagentaYellowBlack" xml:space="preserve"> + <value>Cyan / Magenta / Yellow / Black</value> + <comment>CMYK help text</comment> + </data> <data name="EventHandlersSelectedElement" xml:space="preserve"> <value>Event handlers for the selected element</value> </data> <data name="Events" xml:space="preserve"> <value>Events</value> </data> + <data name="Green" xml:space="preserve"> + <value>Green</value> + <comment>Green textbox help text</comment> + </data> + <data name="GreenInitial" xml:space="preserve"> + <value>G</value> + <comment>Green initial used as green textbox label</comment> + </data> + <data name="HexValue" xml:space="preserve"> + <value>Hex value</value> + <comment>Hex value textbox help text</comment> + </data> + <data name="HLS" xml:space="preserve"> + <value>HLS</value> + <comment>Hue lightness saturation menu entry</comment> + </data> + <data name="HSB" xml:space="preserve"> + <value>HSB</value> + <comment>Hue saturation brightness menu entry</comment> + </data> + <data name="Hue" xml:space="preserve"> + <value>Hue</value> + <comment>Hue textbox help text</comment> + </data> + <data name="HueInitial" xml:space="preserve"> + <value>H</value> + <comment>Hue initial used as hue textbox label</comment> + </data> + <data name="HueLightnessSaturation" xml:space="preserve"> + <value>Hue / Lightness / Saturation</value> + <comment>HLS help text</comment> + </data> + <data name="HueSaturationBrightness" xml:space="preserve"> + <value>Hue / Saturation / Brightness</value> + <comment>HSB help text</comment> + </data> + <data name="InitialColor" xml:space="preserve"> + <value>Initial color</value> + <comment>Initial color button help text</comment> + </data> + <data name="LastColor" xml:space="preserve"> + <value>Last color</value> + <comment>Last color help text</comment> + </data> + <data name="Lightness" xml:space="preserve"> + <value>Lightness</value> + <comment>Lightness textbox help text</comment> + </data> + <data name="LightnessInitial" xml:space="preserve"> + <value>L</value> + <comment>Lightness initial used as lightness textbox label</comment> + </data> + <data name="Magenta" xml:space="preserve"> + <value>Magenta</value> + <comment>Magenta textbox help text</comment> + </data> + <data name="MagentaInitial" xml:space="preserve"> + <value>M</value> + <comment>Magenta initial used as magenta textbox label</comment> + </data> <data name="MultipleObjectsSelected" xml:space="preserve"> <value>{0} objects selected</value> </data> @@ -141,6 +257,30 @@ <data name="PropertiesSelectedElement" xml:space="preserve"> <value>Properties for the selected element</value> </data> + <data name="Red" xml:space="preserve"> + <value>Red</value> + <comment>Red textbox help text</comment> + </data> + <data name="RedGreenBlue" xml:space="preserve"> + <value>Red / Green/ Blue</value> + <comment>RGB help text</comment> + </data> + <data name="RedInitial" xml:space="preserve"> + <value>R</value> + <comment>Red initial used as red textbox label</comment> + </data> + <data name="RGB" xml:space="preserve"> + <value>RGB</value> + <comment>Red green blue menu entry</comment> + </data> + <data name="Saturation" xml:space="preserve"> + <value>Saturation</value> + <comment>Saturation textbox help text</comment> + </data> + <data name="SaturationInitial" xml:space="preserve"> + <value>S</value> + <comment>Saturation initial used as saturation textbox label</comment> + </data> <data name="Type" xml:space="preserve"> <value>Type</value> </data> @@ -148,4 +288,12 @@ <value>View properties or events</value> <comment>Properties/Events narrator help text</comment> </data> + <data name="Yellow" xml:space="preserve"> + <value>Yellow</value> + <comment>Yellow textbox help text</comment> + </data> + <data name="YellowInitial" xml:space="preserve"> + <value>Y</value> + <comment>Yellow initial used as yellow textbox label</comment> + </data> </root>
\ No newline at end of file diff --git a/Xamarin.PropertyEditing/ViewModels/SolidBrushPropertyViewModel.cs b/Xamarin.PropertyEditing/ViewModels/SolidBrushPropertyViewModel.cs index 33e37bb..a3226e7 100644 --- a/Xamarin.PropertyEditing/ViewModels/SolidBrushPropertyViewModel.cs +++ b/Xamarin.PropertyEditing/ViewModels/SolidBrushPropertyViewModel.cs @@ -17,7 +17,7 @@ namespace Xamarin.PropertyEditing.ViewModels CommonColor? hueColor; public CommonColor HueColor { - get => (hueColor.HasValue ? hueColor.Value : (hueColor = LastColor.HueColor)).Value; + get => (hueColor ?? (hueColor = LastColor.HueColor)).Value; set { if (!hueColor.Equals(value)) { var saturation = Color.Saturation; |