diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
9 files changed, 250 insertions, 23 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 18fb0726f..ad185f1a3 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -117,7 +117,14 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty UpdateBindingOnlyWhenFocusedProperty = DependencyProperty.Register("UpdateBindingOnlyWhenFocused", typeof(bool), typeof(TouchNumericTextBox), new PropertyMetadata(false)); - + public virtual bool HasError + { + get + { + return Validation.GetHasError(this); + } + } + public override void OnApplyTemplate() { @@ -161,13 +168,16 @@ namespace Tango.Touch.Controls value = Math.Round(value, 0); } - if (value < Minimum) - { - value = Minimum; - } - else if (value > Maximum) + if (Maximum > Minimum) { - value = Maximum; + if (value < Minimum) + { + value = Minimum; + } + else if (value > Maximum) + { + value = Maximum; + } } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml index d347480d6..f26e53e73 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.xaml @@ -8,8 +8,8 @@ xmlns:local="clr-namespace:Tango.Touch.Controls"> <ResourceDictionary.MergedDictionaries> - <!--<ResourceDictionary Source="../Resources/Colors.xaml" />--> - <components:SharedResourceDictionary Source="../Resources/Colors.xaml" /> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + <!--<components:SharedResourceDictionary Source="../Resources/Colors.xaml" />--> <components:SharedResourceDictionary Source="../Resources/Fonts.xaml" /> </ResourceDictionary.MergedDictionaries> @@ -40,8 +40,8 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" keyboard:KeyboardView.Container="{TemplateBinding KeyboardContainer}"> <DockPanel> - <Canvas DockPanel.Dock="Bottom" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=(Validation.HasError),Converter={StaticResource BooleanToVisibilityConverter}}"> - <TextBlock FontSize="12" Foreground="{StaticResource TangoValidationErrorBrush}" Margin="0 5 0 0" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=(Validation.Errors).CurrentItem.ErrorContent}"></TextBlock> + <Canvas DockPanel.Dock="Bottom" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=HasError,Converter={StaticResource BooleanToVisibilityConverter}}"> + <TextBlock FontSize="12" Foreground="{StaticResource TangoValidationErrorBrush}" Margin="0 5 0 0" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=(Validation.Errors)/ErrorContent}"></TextBlock> </Canvas> <DockPanel> <Grid DockPanel.Dock="Bottom" Height="2"> @@ -72,7 +72,7 @@ </BeginStoryboard> </DataTrigger.ExitActions> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=(Validation.HasError)}" Value="True"> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNumericTextBox},Path=HasError}" Value="True"> <Setter Property="Fill" Value="{StaticResource TangoValidationErrorBrush}"></Setter> <Setter Property="RenderTransform"> <Setter.Value> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml index dcb52859e..c95c87782 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.xaml @@ -8,7 +8,8 @@ xmlns:local="clr-namespace:Tango.Touch.Controls"> <ResourceDictionary.MergedDictionaries> - <components:SharedResourceDictionary Source="../Resources/Colors.xaml" /> + <!--<components:SharedResourceDictionary Source="../Resources/Colors.xaml" />--> + <ResourceDictionary Source="../Resources/Colors.xaml" /> <ResourceDictionary> <converters:StringNullOrEmptyToBooleanConverter x:Key="StringNullOrEmptyToBooleanConverter" /> @@ -39,7 +40,7 @@ <DockPanel> <Border DockPanel.Dock="Bottom" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:TouchTextBox},Path=(Validation.HasError),Converter={StaticResource BooleanToVisibilityConverter}}"> <Canvas> - <TextBlock FontSize="12" Width="{Binding RelativeSource={RelativeSource AncestorType=Border},Path=ActualWidth}" Foreground="{StaticResource TangoValidationErrorBrush}" Margin="0 5 0 0" TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchTextBox},Path=(Validation.Errors).CurrentItem.ErrorContent}"></TextBlock> + <TextBlock FontSize="12" Width="{Binding RelativeSource={RelativeSource AncestorType=Border},Path=ActualWidth}" Foreground="{StaticResource TangoValidationErrorBrush}" Margin="0 5 0 0" TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchTextBox},Path=(Validation.Errors)/ErrorContent}"></TextBlock> </Canvas> </Border> <DockPanel> diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml index df917b20e..f8db0094f 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml @@ -21,6 +21,7 @@ <sys:Double x:Key="TangoMessageBoxButtonFontSize">22</sys:Double> <sys:Double x:Key="TangoExpanderHeaderFontSize">23</sys:Double> + <sys:Double x:Key="TangoDialogFontSize">23</sys:Double> <sys:Double x:Key="TangoExpanderItemFontSize">21</sys:Double> <sys:Double x:Key="TangoComboBoxTitleFontSize">26</sys:Double> diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml new file mode 100644 index 000000000..d61203e3b --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchExpander.xaml @@ -0,0 +1,107 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="clr-namespace:Tango.Touch.Controls" + xmlns:local="clr-namespace:Tango.Touch.Styles"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style x:Key="TouchRoundedExpander" TargetType="{x:Type controls:TouchExpander}"> + <Setter Property="Padding" Value="10"></Setter> + <Setter Property="CornerRadius" Value="20"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:TouchExpander}"> + <controls:TouchDropShadowBorder Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" CornerRadius="{TemplateBinding CornerRadius}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <DockPanel Grid.Row="0"> + <controls:TouchToggleButton CornerRadius="50" RenderTransformOrigin="0.5,0.5" Background="Transparent" EnableDropShadow="False" Width="60" Height="60" DockPanel.Dock="Right" IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controls:TouchExpander},Path=IsExpanded,Mode=TwoWay}"> + <controls:TouchToggleButton.RenderTransform> + <RotateTransform x:Name="Rotate" /> + </controls:TouchToggleButton.RenderTransform> + <controls:TouchToggleButton.Triggers> + <EventTrigger RoutedEvent="ToggleButton.Checked"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetName="Rotate" Storyboard.TargetProperty="Angle" Duration="00:00:0.2" To="360" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="ToggleButton.Unchecked"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetName="Rotate" Storyboard.TargetProperty="Angle" Duration="00:00:0.2" To="0" /> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </controls:TouchToggleButton.Triggers> + <controls:TouchToggleButton.CheckedContent> + <Grid> + <controls:TouchIcon Icon="ChevronDown" Foreground="{StaticResource TangoExpanderIconForegroundBrush}" Width="12" Height="12" Background="Transparent" /> + </Grid> + </controls:TouchToggleButton.CheckedContent> + <Grid> + <controls:TouchIcon Icon="ChevronUpSolid" Foreground="{StaticResource TangoExpanderIconForegroundBrush}" Width="12" Height="12" /> + </Grid> + </controls:TouchToggleButton> + + <ToggleButton IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controls:TouchExpander},Path=IsExpanded,Mode=TwoWay}"> + <ToggleButton.Template> + <ControlTemplate TargetType="ToggleButton"> + <ContentPresenter/> + </ControlTemplate> + </ToggleButton.Template> + <Border Background="Transparent"> + <ContentPresenter Content="{TemplateBinding Header}" /> + </Border> + </ToggleButton> + </DockPanel> + + <Grid Grid.Row="1"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform x:Name="scaleTransform" ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=controls:TouchExpander},Path=IsExpanded}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="(Grid.LayoutTransform).(ScaleTransform.ScaleY)" Duration="00:00:0.2" To="1" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="(Grid.LayoutTransform).(ScaleTransform.ScaleY)" Duration="00:00:0.2" To="0" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <ContentPresenter Content="{TemplateBinding Content}" /> + </Grid> + </Grid> + </controls:TouchDropShadowBorder> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml new file mode 100644 index 000000000..f50e04742 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml @@ -0,0 +1,98 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.Touch.Controls" + xmlns:local="clr-namespace:Tango.Touch.Styles"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + <ResourceDictionary Source="../Resources/Fonts.xaml" /> + <ResourceDictionary Source="../Styles/TouchButton.xaml" /> + <ResourceDictionary Source="../Styles/TouchIconButton.xaml" /> + + <ResourceDictionary> + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + + <SolidColorBrush x:Key="TransparentBrush" Color="Transparent" /> + + <Style x:Key="TouchNumericMiddleUpDownControl" TargetType="{x:Type controls:TouchNumericUpDownConrol}"> + <Setter Property="Background" Value="{StaticResource TangoNotificationBarMaskBrush}"/> + <Setter Property="Height" Value="32"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="controls:TouchNumericUpDownConrol"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Resources> + <Style x:Key="emptyButton" TargetType="RepeatButton" > + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Focusable" Value="False"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoMidAccentBrush}" /> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="RepeatButton"> + <Border Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"> + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="RepeatButton.IsPressed" Value="True"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Foreground" Value="{StaticResource TangoKeyboardKeyLightBrush}" /> + </Trigger> + <EventTrigger RoutedEvent="RepeatButton.TouchDown"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyLightTextBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="RepeatButton.TouchLeave"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyDarkTextBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </StackPanel.Resources> + <RepeatButton Background="Transparent" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=DecrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center"> + <controls:TouchIcon Icon="Minus" Width="16" Height="3" VerticalAlignment="Center"/> + </RepeatButton> + + <controls:TouchNumericTextBox x:Name="Number_PART" Margin="16 4 0 0" FontSize="20" HorizontalContentAlignment="Center" VerticalAlignment="Center" BorderBrush="{TemplateBinding BorderBrush}" VerticalContentAlignment="Center" UpdateBindingOnlyWhenFocused="True" + Value="{Binding Value,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" Minimum="{Binding MinValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}}" Maximum="{Binding MaxValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}"/> + + + <RepeatButton Background="Transparent" Margin="16 0 0 0" Padding="4" Style="{StaticResource emptyButton}" Command="{Binding Path=IncrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center"> + <controls:TouchIcon Icon="Plus" Width="16" VerticalAlignment="Center"/> + </RepeatButton> + + </StackPanel> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index d7a25aeff..ae5ac91e3 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -147,6 +147,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Styles\TouchExpander.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Styles\TouchNumericUpDownControl.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="TouchColorPickerControls\MultiRangeSlider.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -480,7 +488,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index 132082d81..c2c6c0bc9 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -60,6 +60,8 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchCheckBox.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchExpander.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchNumericUpDownControl.xaml"/> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchPanel.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/TouchColorPickerControls/TouchColorPickerSlider.xaml"/> diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs index c32310897..39eab1984 100644 --- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs +++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs @@ -283,7 +283,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnCyanPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnCyanPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } @@ -300,7 +300,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnMagentaLabPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnMagentaLabPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } @@ -317,7 +317,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnYellowPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnYellowPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } private void OnYellowPropertyChanged(double oldValue, double newValue) @@ -333,7 +333,7 @@ namespace Tango.Touch.Controls TouchColorPickerCMYKControl TouchColorPickerCMYKControl = (TouchColorPickerCMYKControl)d; if (TouchColorPickerCMYKControl != null) { - TouchColorPickerCMYKControl.OnKeyPropertyChanged((double)e.OldValue, (double)e.NewValue); + TouchColorPickerCMYKControl.OnKeyPropertyChanged((double)e.OldValue, Math.Round((double)e.NewValue, 2, MidpointRounding.AwayFromZero)); } } private void OnKeyPropertyChanged(double oldValue, double newValue) @@ -401,7 +401,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(e.NewValue / 100, _magentaColorSlider.ColorValue / 100, _yellowColorSlider.ColorValue / 100, _keyColorSlider.ColorValue / 100); //_cyanColorSlider.SelectedColor = SelectedColor; - Cyan = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Cyan = e.NewValue; _cyanColorSlider.SelectedColor = GetRelativeColor(_cyanColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _cyanColorSlider.MinValue, _cyanColorSlider.MaxValue)); @@ -423,7 +423,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, e.NewValue / 100, _yellowColorSlider.ColorValue / 100, _keyColorSlider.ColorValue / 100); //_magentaColorSlider.SelectedColor = SelectedColor; - Magenta = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Magenta = e.NewValue; _magentaColorSlider.SelectedColor = GetRelativeColor(_magentaColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _magentaColorSlider.MinValue, _magentaColorSlider.MaxValue)); @@ -445,7 +445,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, _magentaColorSlider.ColorValue / 100, e.NewValue / 100, _keyColorSlider.ColorValue / 100); //_yellowColorSlider.SelectedColor = SelectedColor; - Yellow = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Yellow = e.NewValue; _yellowColorSlider.SelectedColor = GetRelativeColor(_yellowColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _yellowColorSlider.MinValue, _yellowColorSlider.MaxValue)); @@ -467,7 +467,7 @@ namespace Tango.Touch.Controls { SelectedColor = ConvertCMYKToRGBColor(_cyanColorSlider.ColorValue / 100, _magentaColorSlider.ColorValue / 100, _yellowColorSlider.ColorValue / 100, e.NewValue / 100); //_keyColorSlider.SelectedColor = SelectedColor; - Key = Math.Round(e.NewValue, 2, MidpointRounding.AwayFromZero); + Key = e.NewValue; _keyColorSlider.SelectedColor = GetRelativeColor(_keyColorSlider.PickerBrush.GradientStops, GetOffset(e.NewValue, _keyColorSlider.MinValue, _keyColorSlider.MaxValue)); |
