aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml269
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs388
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs26
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs19
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml2
7 files changed, 640 insertions, 72 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
index 56e3ff211..8ab9c52e9 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
@@ -127,7 +127,9 @@
<Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="200"></RowDefinition>
- <RowDefinition Height="1*"></RowDefinition>
+ <RowDefinition Height="Auto"></RowDefinition>
+ <RowDefinition Height="Auto"></RowDefinition>
+ <RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="24 40 24 0">
@@ -159,73 +161,236 @@
</StackPanel>
</StackPanel>
<Grid Grid.Row="1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="2*"/>
+ </Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="24 10 24 0">
<Image Stretch="Fill" Width="36" Height="36" RenderOptions.BitmapScalingMode="Fant" Source="../Images/ColorSelection/CorrectionTrial.png" HorizontalAlignment="Left"></Image>
<TextBlock Margin="11 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoMessageBoxButtonFontSize}" >
<Run Text="Correction " ></Run>
+ <LineBreak/>
<Run Text="Trial #" Foreground="{StaticResource TangoGrayTextBrush}"></Run>
<Run Text="{Binding TrialNumber, Mode=OneWay}" Foreground="{StaticResource TangoGrayTextBrush}"></Run>
</TextBlock>
</StackPanel>
- <Grid Margin="78 70 0 0">
+ <Grid Grid.Column="1" Margin="0 0 24 0">
+ <StackPanel Orientation="Vertical" VerticalAlignment="Top">
+ <UniformGrid Rows="1" Columns="3" Height="80" VerticalAlignment="Top" Width="Auto" MinWidth="380" HorizontalAlignment="Left">
+ <UniformGrid.Style>
+ <Style TargetType="UniformGrid">
+ <Setter Property="IsEnabled" Value="True"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsDisableInputLAB}" Value="True">
+ <Setter Property="IsEnabled" Value="False"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </UniformGrid.Style>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="L" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" />
+ <touch:TouchNumericTextBox Margin="20 -10 20 0" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" Maximum="100" Minimum="0" Value="{Binding MeasuredL, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock Text="a" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center"/>
+ <touch:TouchNumericTextBox Margin="20 -10 20 0" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" Maximum="127" Minimum="-128" Value="{Binding MeasuredA, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold" VerticalAlignment="Top" />
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="b" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center"/>
+ <touch:TouchNumericTextBox Margin="20 -10 20 0" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" Maximum="127" Minimum="-128" Value="{Binding MeasuredB, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold"/>
+ </StackPanel>
+ </UniformGrid>
+ <UniformGrid Columns="4" Rows="1" Height="80" VerticalAlignment="Top" Width="Auto" MinWidth="380" Margin="0 20 0 0">
+
+ <StackPanel Orientation="Vertical">
+ <StackPanel Orientation="Horizontal">
+ <Polygon Points="7.5,0 15,15, 0,15" Stroke="Black" Fill="Transparent" />
+ <TextBlock Text=" E CMC" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="2 0 -2 0"/>
+ </StackPanel>
+ <TextBlock IsHitTestVisible="False" Text="{Binding DeltaE, StringFormat=0.00}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 10 0"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical" Margin="0 0 0 0">
+ <StackPanel Orientation="Horizontal">
+ <Polygon Points="7.5,0 15,15, 0,15" Stroke="Black" Fill="Transparent" />
+ <TextBlock Text=" L" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="2 0 -2 0"/>
+ </StackPanel>
+ <TextBlock IsHitTestVisible="False" Text="{Binding DL, StringFormat=0.00}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 10 0"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical">
+ <StackPanel Orientation="Horizontal">
+ <Polygon Points="7.5,0 15,15, 0,15" Stroke="Black" Fill="Transparent" />
+ <TextBlock Text=" C" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="2 0 -2 0"/>
+ </StackPanel>
+ <TextBlock IsHitTestVisible="False" Text="{Binding DC, StringFormat=0.00}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 10 0"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical">
+ <StackPanel Orientation="Horizontal">
+ <Polygon Points="7.5,0 15,15, 0,15" Stroke="Black" Fill="Transparent" />
+ <TextBlock Text=" H" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="2 0 -2 0"/>
+ </StackPanel>
+ <TextBlock IsHitTestVisible="False" Text="{Binding DH, StringFormat=0.00}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 10 0"/>
+ </StackPanel>
+ </UniformGrid>
+
+ </StackPanel>
+ </Grid>
+
+ </Grid>
+ <Grid Grid.Row="2">
+ <Rectangle HorizontalAlignment="Stretch" Fill="{StaticResource TangoDropShadowBrush}" Height="1" VerticalAlignment="Top" Margin="40 0 40 0"/>
+ <Grid Margin="20 20 5 40">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*"></ColumnDefinition>
- <ColumnDefinition Width="311"></ColumnDefinition>
+ <ColumnDefinition Width="200"/>
+ <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
- <UniformGrid Rows="3" Columns="1" Height="176" VerticalAlignment="Top">
- <UniformGrid.Style>
- <Style TargetType="UniformGrid">
- <Setter Property="IsEnabled" Value="True"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsDisableInputLAB}" Value="True">
- <Setter Property="IsEnabled" Value="False"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </UniformGrid.Style>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="L" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center" />
- <touch:TouchNumericUpDownConrol Margin="30 0 0 0" NumericPartWidth="94.0" Width="200" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" MaxValue="100" MinValue="0" Value="{Binding MeasuredL, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="a" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center"/>
- <touch:TouchNumericUpDownConrol Margin="30 0 0 0" NumericPartWidth="94.0" Width="200" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" MaxValue="127" MinValue="-128" Value="{Binding MeasuredA, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="b" FontSize="{StaticResource TangoComboBoxItemFontSize}" FontWeight="SemiBold" VerticalAlignment="Center"/>
- <touch:TouchNumericUpDownConrol Margin="30 0 0 0" NumericPartWidth="94.0" Width="200" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" MaxValue="127" MinValue="-128" Value="{Binding MeasuredB, Delay=1000}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Bold"/>
- </StackPanel>
- </UniformGrid>
+ <touch:TouchRadioButton GroupName="Correction" FontSize="{StaticResource TangoTitleFontSize}" VerticalAlignment="Top" IsChecked="{Binding IsVectorFineTuning, Mode=TwoWay}" Margin="0 -10 0 0 ">Vector correction:</touch:TouchRadioButton>
+ <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20 -2 0 0">
+ <UniformGrid Rows="1" Columns="3" Height="30" MinWidth="150" VerticalAlignment="Top">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="L" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionL, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" Margin="5 0 0 0">
+ <TextBlock Text="a" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionA, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
+ <TextBlock Text="b" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionB, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ </UniformGrid>
+ <UniformGrid Rows="3" Columns="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 20 0 0">
+ <UniformGrid.Resources>
+ <Style TargetType="touch:TouchCheckBox">
+ <Setter Property="MinHeight" Value="20"></Setter>
+ <Setter Property="IsEnabled" Value="true"></Setter>
+ <Setter Property="HorizontalAlignment" Value="Left"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding Path=IsOnlyOneChecked}" Value="True" />
+ <Condition Binding="{Binding Path=IsChecked, RelativeSource={RelativeSource Self}}" Value="True" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="IsEnabled" Value="false" />
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </UniformGrid.Resources>
+ <touch:TouchCheckBox Margin="0 0 0 0" IsChecked="{Binding CorrectLightness, Mode=TwoWay}" >Correct Lightness</touch:TouchCheckBox>
+ <touch:TouchCheckBox Margin="0 10 0 0" IsChecked="{Binding CorrectChroma, Mode=TwoWay}">Correct Chroma</touch:TouchCheckBox>
+ <touch:TouchCheckBox Margin="0 10 0 0" IsChecked="{Binding CorrectHue, Mode=TwoWay}">Correct Hue</touch:TouchCheckBox>
+ </UniformGrid>
+ </StackPanel>
+ </Grid>
+ </Grid>
+ <Grid Grid.Row="3">
+ <Rectangle HorizontalAlignment="Stretch" Fill="{StaticResource TangoDropShadowBrush}" Height="1" VerticalAlignment="Top" Margin="40 0 40 0"/>
+ <Grid Margin="20 20 5 40">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="200"/>
+ <ColumnDefinition Width="1*"/>
+ </Grid.ColumnDefinitions>
+ <touch:TouchRadioButton VerticalAlignment="Top" FontSize="{StaticResource TangoTitleFontSize}" GroupName="Correction" IsChecked="{Binding IsVectorFineTuning, Mode=TwoWay, Converter={StaticResource BooleanInverseConverter}}" Margin="0 -10 0 0 ">Visual correction:</touch:TouchRadioButton>
+ <Grid Height="100" Margin="20 40 0 0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
+ <Border Height="80" Width="120" Margin="0 10 0 0" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="1" Background="{Binding ColorBrush}" CornerRadius="12" />
+ <Border Height="80" Width="80" Margin="40 10 0 0" CornerRadius="12" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}" Background="{Binding ColorBrush}">
- <!--<UniformGrid Grid.Column="1" x:Name="cmyk_grid" Margin="0 16 0 0" Rows="4" Columns="1" HorizontalAlignment="Left" Height=" 100" VerticalAlignment="Top">
- <StackPanel Orientation="Horizontal">
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Width="12" HorizontalAlignment="Center" VerticalAlignment="Center">C</TextBlock>
- <Rectangle Margin="10 0 0 0" Width="{Binding Cyan, Mode=OneWay}" Height="12" Fill="#00C3FF"/>
- <TextBlock FontSize="{StaticResource TangoSmallFontSizeBar}" Margin="10 0 0 0" Text="{Binding Cyan, StringFormat={}{0:0.##}}" VerticalAlignment="Center"></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Width="12" HorizontalAlignment="Center">M</TextBlock>
- <Rectangle Margin="10 0 0 0" Width="{Binding Magenta, Mode=OneWay}" Height="12" Fill="#FF00B3"/>
- <TextBlock Margin="10 0 0 0" Text="{Binding Magenta, StringFormat={}{0:0.##}}" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Width="12" HorizontalAlignment="Center">Y</TextBlock>
- <Rectangle Margin="10 0 0 0" Width="{Binding Yellow, Mode=OneWay}" Height="12" Fill="#FFE500"/>
- <TextBlock Margin="10 0 0 0" Text="{Binding Yellow, StringFormat={}{0:0.##}}" FontSize="{StaticResource TangoSmallFontSizeBar}" ></TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Width="12" HorizontalAlignment="Center">K</TextBlock>
- <Rectangle Margin="10 0 0 0" Width="{Binding Black, Mode=OneWay}" Height="12" Fill="black"/>
- <TextBlock Margin="10 0 0 0" Text="{Binding Black, StringFormat={}{0:0.##}}" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"></TextBlock>
- </StackPanel>
- </UniformGrid>-->
+ <!--<Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Margin" Value="0 10 0 0"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsEditMode}" Value="True">
+ <Setter Property="Margin" Value="130 10 0 0"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Border.Style>-->
+ <!--<Grid>
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding SelectedBrushStop.IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <Image Margin="30 0 24 0" Stretch="Fill" Width="37" Height="33" RenderOptions.BitmapScalingMode="Fant" Source="../Images/ColorSelection/Exclamation.png" HorizontalAlignment="Center"></Image>
+ <Border Margin=" 0 10 0 0" MinWidth="115" Height="31" Background="{StaticResource TangoDarkForegroundBrush}" CornerRadius="2">
+ <TextBlock Margin="10 0" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource TangoLightForegroundBrush}" FontSize="{StaticResource TangoSmallFontSize}" FontWeight="SemiBold" Text="This color is not supported." ></TextBlock>
+ </Border>
+ </StackPanel>
+ </Grid>-->
+ </Border>
+ </Grid>
+ <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20 -2 0 0">
+ <UniformGrid Rows="1" Columns="3" Height="30" MinWidth="150" VerticalAlignment="Top">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="L" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionL, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" Margin="5 0 0 0">
+ <TextBlock Text="a" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionA, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
+ <TextBlock Text="b" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center"/>
+ <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0.8" Width="50">
+ <TextBlock Style="{StaticResource GreyTextStyle}" Text="{Binding VisualCorrectionB, StringFormat=0.00}" ></TextBlock>
+ </Border>
+ </StackPanel>
+ </UniformGrid>
+ <Grid Height="Auto" Margin="20 20 60 0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="60"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="Aqua" CornerRadius="8" Margin="0 25 0 0" Height="60"/>
+ <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
+ <TextBlock Text="Lightness:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 5" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
+ <touch:TouchNumericUpDownConrol Margin="0 10 0 0" Height="35" NumericPartWidth="70" Width="Auto" HorizontalAlignment="Center" BorderThickness="2" BorderBrush="red" MaxValue="10" MinValue="0" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5"/>
+ </StackPanel>
+ <Border Background="Aqua" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0"/>
+ </Grid>
+ <Grid Height="Auto" Margin="20 00 60 0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="60"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="Aqua" CornerRadius="8" Margin="0 25 0 0" Height="60"/>
+ <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
+ <TextBlock Text="Chroma:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 5" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
+ <touch:TouchNumericUpDownConrol Margin="0 10 0 0" Height="35" NumericPartWidth="70" Width="Auto" HorizontalAlignment="Center" BorderThickness="2" BorderBrush="red" MaxValue="10" MinValue="0" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5"/>
+ </StackPanel>
+ <Border Background="Aqua" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0"/>
+ </Grid>
+ <Grid Height="Auto" Margin="20 0 60 0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="60"/>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="60"/>
+ </Grid.ColumnDefinitions>
+ <Border Background="Aqua" CornerRadius="8" Margin="0 25 0 0" Height="60"/>
+ <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
+ <TextBlock Text="Hue:" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 0 0 5" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
+ <touch:TouchNumericUpDownConrol Margin="0 10 0 0" Height="35" NumericPartWidth="70" Width="Auto" HorizontalAlignment="Center" BorderThickness="2" BorderBrush="red" MaxValue="10" MinValue="0" Style="{StaticResource TouchNumericMiddleUpDownControl}" Step="0.5"/>
+ </StackPanel>
+ <Border Background="Aqua" CornerRadius="8" Grid.Column="2" Height="60" Margin="0 25 0 0"/>
+ </Grid>
+ </StackPanel>
</Grid>
-
</Grid>
</Grid>
- <Border BorderThickness="0" Grid.Row="1">
+ <Border BorderThickness="0" Grid.RowSpan="01" VerticalAlignment="Bottom">
<!--<Border.Style >
<Style TargetType="Border">
<Setter Property="IsEnabled" Value="True"/>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
index 596eb9316..3baf6ae3e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
@@ -1,4 +1,6 @@
-using System;
+using Colourful;
+using Colourful.Conversion;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
@@ -166,7 +168,7 @@ namespace Tango.PPC.Jobs.Dialogs
protected Double? _measuredL;
/// <summary>
- /// Gets or sets the BrushStopModel l.
+ /// Gets or sets the Measured l.
/// </summary>
public Double? MeasuredL
@@ -192,7 +194,7 @@ namespace Tango.PPC.Jobs.Dialogs
protected Double? _measuredA;
/// <summary>
- /// Gets or sets the BrushStopModel a.
+ /// Gets or sets the Measured a.
/// </summary>
public Double? MeasuredA
{
@@ -216,7 +218,7 @@ namespace Tango.PPC.Jobs.Dialogs
protected Double? _measuredB;
/// <summary>
- /// Gets or sets the BrushStopModel b.
+ /// Gets or sets the Measured b.
/// </summary>
public Double? MeasuredB
{
@@ -236,7 +238,194 @@ namespace Tango.PPC.Jobs.Dialogs
}
}
}
-
+
+ protected double _VectorCorrectionL;
+
+ public double VectorCorrectionL
+ {
+ get
+ {
+ return _VectorCorrectionL;
+ }
+
+ set
+ {
+ if (_VectorCorrectionL != value)
+ {
+ _VectorCorrectionL = value;
+ RaisePropertyChangedAuto();
+ // OnLABChanged();
+ }
+ }
+ }
+
+ protected double _VectorCorrectionA;
+
+ public double VectorCorrectionA
+ {
+ get
+ {
+ return _VectorCorrectionA;
+ }
+
+ set
+ {
+ if (_VectorCorrectionA != value)
+ {
+ _VectorCorrectionA = value;
+ RaisePropertyChangedAuto();
+ // OnLABChanged();
+ }
+ }
+ }
+
+ protected double _VectorCorrectionB;
+
+ public double VectorCorrectionB
+ {
+ get
+ {
+ return _VectorCorrectionB;
+ }
+
+ set
+ {
+ if (_VectorCorrectionB != value)
+ {
+ _VectorCorrectionB = value;
+ RaisePropertyChangedAuto();
+ // OnLABChanged();
+ }
+ }
+ }
+
+ protected Double? _dL;
+
+ /// <summary>
+ /// Gets or sets the delta L
+ /// </summary>
+ public Double? DL
+ {
+ get { return _dL; }
+ set
+ {
+ if (_dL != value)
+ {
+ _dL = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ protected Double? _dC;
+ /// <summary>
+ /// Gets or sets the delta C
+ /// </summary>
+ public Double? DC
+ {
+ get { return _dC; }
+ set
+ {
+ if (_dC != value)
+ {
+ _dC = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ protected Double? _dH;
+ /// <summary>
+ /// Gets or sets the delta Hue
+ /// </summary>
+ public Double? DH
+ {
+ get { return _dH; }
+ set
+ {
+ if (_dH != value)
+ {
+ _dH = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ protected Double? _deltaE;
+ /// <summary>
+ /// Gets or sets the delta Hue
+ /// </summary>
+ public Double? DeltaE
+ {
+ get { return _deltaE; }
+ set
+ {
+ if (_deltaE != value)
+ {
+ _deltaE = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private bool _correctLightness;
+
+ public bool CorrectLightness
+ {
+ get { return _correctLightness; }
+ set {
+ if(_correctLightness != value)
+ {
+ _correctLightness = value;
+ VectorCorrection();
+ RaisePropertyChanged(nameof(IsOnlyOneChecked));
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private bool _correctChroma;
+
+ public bool CorrectChroma
+ {
+ get { return _correctChroma; }
+ set
+ {
+ if(_correctChroma != value)
+ {
+ _correctChroma = value;
+ VectorCorrection();
+ RaisePropertyChanged(nameof(IsOnlyOneChecked));
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private bool _correctHue;
+
+ public bool CorrectHue
+ {
+ get { return _correctHue; }
+ set
+ {
+ if(_correctHue != value)
+ {
+ _correctHue = value;
+ VectorCorrection();
+ RaisePropertyChanged( nameof(IsOnlyOneChecked));
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ public bool IsOnlyOneChecked
+ {
+ get { return (!CorrectLightness && (!CorrectChroma || !CorrectHue)
+ || (CorrectLightness && !CorrectHue && !CorrectHue));
+ }
+ }
+
+
protected Double _cyan;
/// <summary>
@@ -426,6 +615,68 @@ namespace Tango.PPC.Jobs.Dialogs
}
}
+ private bool _isVectorFineTuning;
+
+ public bool IsVectorFineTuning
+ {
+ get { return _isVectorFineTuning; }
+ set {
+ if(_isVectorFineTuning != value)
+ {
+ _isVectorFineTuning = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private double _lightnessOffset;
+
+ public double LightnessOffset
+ {
+ get { return _lightnessOffset; }
+ set {
+ if(_lightnessOffset != value)
+ {
+ _lightnessOffset = value;
+ VisualCollection();
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private double _chromaOffset;
+
+ public double ChromaOffset
+ {
+ get { return _chromaOffset; }
+ set
+ {
+ if (_chromaOffset != value)
+ {
+ _chromaOffset = value;
+ VisualCollection();
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+ private double _hueOffset;
+
+ public double HueOffset
+ {
+ get { return _hueOffset; }
+ set
+ {
+ if (_hueOffset != value)
+ {
+ _hueOffset = value;
+ VisualCollection();
+ RaisePropertyChangedAuto();
+ }
+ }
+ }
+
+
#endregion
@@ -460,6 +711,12 @@ namespace Tango.PPC.Jobs.Dialogs
IsExpanderOpened = true;
TangoIOC.Default.Inject(this);
+
+ _correctHue = true;
+ _correctChroma = true;
+ _correctLightness = true;
+
+ IsVectorFineTuning = true;
}
public void Init(BrushStopModel brushstop, double l, double a, double b, System.Windows.Media.Color targetColor)
@@ -823,8 +1080,14 @@ namespace Tango.PPC.Jobs.Dialogs
// await NotificationProvider.ShowInfo("Color is out of gamut!");
//}
- var deltaE = DeltaE_CMC(TargetL, TargetA, TargetB, (double)MeasuredL, (double)MeasuredA, (double)MeasuredB);
- ActiveLogModel.DeltaE = deltaE;
+ double dL, dC, dH;
+ DeltaE = DeltaE_CMC(TargetL, TargetA, TargetB, (double)MeasuredL, (double)MeasuredA, (double)MeasuredB, out dL, out dC, out dH);
+
+ DL = dL;
+ DC = (Double?)dC;
+ DH = (Double?)dH;
+ ActiveLogModel.DeltaE = DeltaE;
+ VectorCorrection();
ValidationTests();
}
TestCommand.RaiseCanExecuteChanged();
@@ -1090,7 +1353,7 @@ namespace Tango.PPC.Jobs.Dialogs
#region Delta E
- double DeltaE_CMC(double L1, double a1, double b1, double L2, double a2, double b2)
+ double DeltaE_CMC(double L1, double a1, double b1, double L2, double a2, double b2, out double dL, out double dC, out double dH)
{
double h1 = Math.Atan2(b1, a1) * (180 / Math.PI);
if (h1 < 0)
@@ -1128,11 +1391,11 @@ namespace Tango.PPC.Jobs.Dialogs
//chroma calculation
double samX_C = Math.Sqrt(a2 * a2 + b2 * b2);
- double dL = L1 - L2;
- double dC = samX_C - refX_C;
+ dL = L1 - L2;
+ dC = samX_C - refX_C;
double da = a1 - a2;
double db = b1 - b2;
- double dH = Math.Sqrt(Math.Max(da * da + db * db - dC * dC, 0.0));
+ dH = Math.Sqrt(Math.Max(da * da + db * db - dC * dC, 0.0));
double dECMC = Math.Sqrt(Math.Pow(dL / (2 * refX_SL), 2) + Math.Pow(dC / refX_SC, 2) + Math.Pow(dH / refX_SH, 2));
return dECMC;
@@ -1229,6 +1492,109 @@ namespace Tango.PPC.Jobs.Dialogs
return inclusiveMinimum;
}
+ protected void VectorCorrection()
+ {
+ if (ActiveLogModel == null || !IsValidLAB())
+ return;
+
+
+ if (CorrectLightness && CorrectChroma && CorrectHue)
+ {
+ VectorCorrectionL = (double)MeasuredL;
+ VectorCorrectionA = (double)MeasuredA;
+ VectorCorrectionB = (double)MeasuredB;
+ //ActiveLogModel.DeltaE = DeltaE;
+ //ValidationTests();
+ return;
+ }
+ LabColor labColor = new LabColor(ActiveLogModel.SuggestionL, ActiveLogModel.SuggestionA, ActiveLogModel.SuggestionB);
+ var converter = new ColourfulConverter { WhitePoint = Illuminants.D65 };
+ var last_LCH = converter.ToLChab(labColor);
+
+ LabColor labColor1 = new LabColor((double)MeasuredL, (double)MeasuredA, (double)MeasuredB);
+ var measured_LCH = converter.ToLChab(labColor1);
+ double L = measured_LCH.L;
+ double C = measured_LCH.C;
+ double H = measured_LCH.h;
+ if (!CorrectLightness)
+ {
+ L = last_LCH.L;
+ }
+ if(!CorrectChroma)
+ {
+ C = last_LCH.C;
+ }
+ if (!CorrectHue)
+ {
+ H = last_LCH.h;
+ }
+ LabColor lab = converter.ToLab( new LChabColor(L,C,H));
+ VectorCorrectionL = lab.L;
+ VectorCorrectionA = lab.a;
+ VectorCorrectionB = lab.b;
+
+ //ActiveLogModel.DeltaE = DeltaE;
+ //ValidationTests();
+ }
+
+ protected void VisualCorrection()
+ {
+ //LightnessOffset
+ double L1 = 1.0;
+ double C1 = 1.0;
+ double H1 = 1.0;
+ if (H1 < 0)
+ H1 = H1 + 360;
+ double refX_C = C1;
+ // int times = PalleteArr[i, k].Name[1] == '_' ? -1 : 1;
+ //times *= int.Parse(PalleteArr[i, k].Name[2].ToString());
+ //double offset = StepSize * times;
+ //0;-3 and 1,-3,1,3 and 2,3
+ double offset = 0.5;// ????;
+ //LightnessOffset
+ {
+ double SL = 0;
+ if (L1 <= 16)
+ SL = 0.511;
+ else
+ SL = L1 * 0.040975 / (1 + 0.01765 * L1);
+ L1 += offset * 2 * SL;
+ //PalleteArr[i, k].VisibilityProperty = L1 > 100 || L1 < 0 ? Visibility.Hidden : Visibility.Visible;
+ }
+ //chroma
+ {
+ double SC = (0.638 + 0.0638 * refX_C / (1 + 0.0131 * refX_C));
+ C1 += offset * SC;
+ //PalleteArr[i, k].VisibilityProperty = C1 > 128 || C1 < 0 ? Visibility.Hidden : Visibility.Visible;
+ }
+ //hue
+ {
+ double h1 = H1;
+ if (h1 < 0)
+ h1 = h1 + 360;
+ double refX_CQ = Math.Pow(refX_C, 4);
+ double refX_H = h1;
+ double refX_F = Math.Sqrt(refX_CQ / (refX_CQ + 1900));
+ double refX_T = 0;
+ if ((refX_H > 164) & (refX_H < 345))
+ refX_T = 0.56 + Math.Abs(0.2 * Math.Cos(Math.PI * (refX_H + 168) / 180));
+ else if ((refX_H >= 345) | (refX_H <= 164))
+ refX_T = 0.36 + Math.Abs(0.4 * Math.Cos(Math.PI * (refX_H + 35) / 180));
+
+ double refX_SC = (0.638 + 0.0638 * refX_C / (1 + 0.0131 * refX_C));
+ double refX_SH = refX_SC * (refX_T * refX_F + 1 - refX_F);
+ double tmp = (180 / Math.PI) * Math.Acos(1 - (refX_SH * refX_SH * offset * offset / (2 * C1 * C1)));
+ if (times < 0)
+ tmp *= -1;
+ if (Deltas && (PalleteArr[i, k].Name == "H_2" || PalleteArr[i, k].Name == "H02"))
+ {
+ ;
+ }
+ H1 += tmp;// (180 / Math.PI) * Math.Acos(1 - (refX_SH * refX_SH * offset * offset / (2 * C1 * C1)));
+ //PalleteArr[i, k].VisibilityProperty = Visibility.Visible;
+ }
+
+ }
#endregion
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
index a4913dbef..a35d56b08 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/TrialsLogModel.cs
@@ -33,7 +33,7 @@ namespace Tango.PPC.Jobs.Models
return TrialNumber.ToString();
}
}
-
+ //LAB
private double? _l;
public double? L
@@ -48,7 +48,9 @@ namespace Tango.PPC.Jobs.Models
public double? A
{
get { return _a; }
- set { _a = value; RaisePropertyChanged(nameof(LAB)); OnLABChanged(); }
+ set { _a = value;
+ ColorMine.ColorSpaces.Lch TargetLab;
+ RaisePropertyChanged(nameof(LAB)); OnLABChanged(); }
}
private double? _b;
@@ -57,7 +59,27 @@ namespace Tango.PPC.Jobs.Models
get { return _b; }
set { _b = value; RaisePropertyChanged(nameof(LAB)); OnLABChanged(); }
}
+ //LCH
+ private double _LCH_C;
+
+ public double LCH_C
+ {
+ get { return _LCH_C; }
+ set {
+ _LCH_C = value;
+ //RaisePropertyChanged(nameof(LAB));
+ }
+ }
+ private double _h;
+
+ public double H
+ {
+ get { return _h; }
+ set { _h = value;
+ //RaisePropertyChanged(nameof(LAB));
+ }
+ }
public double SuggestionL { get; set; }
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
index 8edc18f1f..616fe0c7b 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
@@ -390,6 +390,10 @@
<Project>{37e4ceab-b54b-451f-b535-04cf7da9c459}</Project>
<Name>ColorMine</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\SideChains\Tango.Colorful\Tango.Colorful.csproj">
+ <Project>{C89C1866-C76B-401F-A232-40FC58065CBF}</Project>
+ <Name>Tango.Colorful</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj">
<Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
<Name>Tango.BL</Name>
@@ -715,7 +719,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/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs
index 2b85e8168..d12dd27b6 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs
@@ -60,6 +60,17 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty MaxValueProperty =
DependencyProperty.Register("MaxValue", typeof(double), typeof(TouchNumericUpDownConrol), new PropertyMetadata(100.0));
+ public double Step
+ {
+ get { return (double)GetValue(StepProperty); }
+ set { SetValue(StepProperty, value); }
+ }
+
+ /// <summary>
+ /// The slider minimum value property
+ /// </summary>
+ public static readonly DependencyProperty StepProperty =
+ DependencyProperty.Register("Step", typeof(double), typeof(TouchNumericUpDownConrol), new PropertyMetadata(1.0));
public double NumericPartWidth
@@ -105,11 +116,11 @@ namespace Tango.Touch.Controls
{
IncrementCommand = new RelayCommand(()=>
{
- Value += 1;
- } , (x)=> { return (Value + 1) <= MaxValue; });
+ Value += Step;
+ } , (x)=> { return (Value + Step) <= MaxValue; });
DecrementCommand = new RelayCommand(() => {
- Value -= 1;
- }, (x) => { return (Value - 1) >= MinValue; });
+ Value -= Step;
+ }, (x) => { return (Value - Step) >= MinValue; });
_changedFromAnotherControl = false;
}
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
index 961b22c0f..d29cd2a48 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml
@@ -82,7 +82,7 @@
</RepeatButton>
<controls:TouchNumericTextBox x:Name="Number_PART" Margin="50 4 0 0" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" 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}" HideUnderline="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}" HideUnderline="True" HasDecimalPoint="True"/>
<RepeatButton Background="Transparent" Height="40" Margin="50 0 0 0" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=IncrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center">