aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-01-30 00:24:58 +0200
committerRoy <roy.mail.net@gmail.com>2018-01-30 00:24:58 +0200
commit26ab24349861999cef4def86ed92da54cba2fc68 (patch)
tree16374bec331864894eb75c03e76fa4f80c356f73 /Software/Visual_Studio/MachineStudio/Modules
parent5cda8b0a3ab579dd6f33b1cb19a1d295dc661d28 (diff)
downloadTango-26ab24349861999cef4def86ed92da54cba2fc68.tar.gz
Tango-26ab24349861999cef4def86ed92da54cba2fc68.zip
Added BrushStop Index...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs54
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml391
4 files changed, 261 insertions, 189 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs
new file mode 100644
index 000000000..c18a5679b
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using Tango.DAL.Observables;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class BrushStopToOffsetLimitConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ BrushStop stop = values[0] as BrushStop;
+ Segment segment = values[1] as Segment;
+ String sign = parameter.ToString();
+
+ if (stop != null && segment != null)
+ {
+
+ if (segment.BrushStops.IndexOf(stop) == segment.BrushStops.Count - 1)
+ {
+ return 100d;
+ }
+ else if (segment.BrushStops.IndexOf(stop) == 0)
+ {
+ return 0d;
+ }
+ else
+ {
+ return sign == "min" ? 0 : 100d;
+ }
+ }
+ else
+ {
+ return 100;
+ }
+ }
+ catch
+ {
+ return 100d;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
index 47604e64d..5bae48c1a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
@@ -74,6 +74,7 @@
<Compile Include="Converters\BrushStopLabToColorConverter.cs" />
<Compile Include="Converters\BrushStopCMYKToColorConverter.cs" />
<Compile Include="Converters\BrushStopToColorConverter.cs" />
+ <Compile Include="Converters\BrushStopToOffsetLimitConverter.cs" />
<Compile Include="Converters\DbRmlViewToEntityConverter.cs" />
<Compile Include="Converters\SegmentToGradientStopsConverter.cs" />
<Compile Include="DeveloperModule.cs" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index a3be7a2d6..5a1b46041 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -593,6 +593,10 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="droppedStop">The dropped stop.</param>
public void OnDropBrushStop(BrushStop draggedStop, BrushStop droppedStop)
{
+ int tmpIndex = draggedStop.StopIndex;
+ draggedStop.StopIndex = droppedStop.StopIndex;
+ droppedStop.StopIndex = tmpIndex;
+
SelectedSegment.BrushStops.Swap(draggedStop, droppedStop);
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
index 9c761309c..90842b672 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
@@ -36,6 +36,7 @@
<localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" />
<localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" />
<localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" />
+ <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" />
<SolidColorBrush x:Key="SideBarBackground" Color="#F9F9F9">
@@ -123,16 +124,14 @@
<Style TargetType="Border" x:Key="JobFieldBorder">
<Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
- <Setter Property="CornerRadius" Value="10"></Setter>
+ <Setter Property="CornerRadius" Value="100 10 100 0"></Setter>
<Setter Property="Padding" Value="10 5"></Setter>
<Setter Property="Margin" Value="0 0 10 0"></Setter>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
- <GradientStop Color="#FFE4E4E4"/>
- <GradientStop Offset="0.2"/>
- <GradientStop Offset="0.5"/>
- <GradientStop Color="#FFEEEEEE" Offset="1"/>
+ <GradientStop Color="#73F4F4F4"/>
+ <GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
@@ -571,203 +570,217 @@
</ListBox.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type observables:BrushStop}">
-
- <Border BorderThickness="1" CornerRadius="5" Margin="0 0 0 5" Padding="10" Background="Transparent" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop">
- <Border.Style>
- <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}">
- <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
- <Setter Property="Background" Value="White"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
- <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
- <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Border.Style>
- <Grid>
- <DockPanel>
- <ContentControl DockPanel.Dock="Left">
- <ContentControl.Style>
- <Style TargetType="ContentControl">
- <Setter Property="Content">
- <Setter.Value>
- <Rectangle/>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume">
- <Setter Property="Content">
- <Setter.Value>
- <StackPanel VerticalAlignment="Center">
- <ItemsControl ItemsSource="{Binding InkVolumes}" VerticalAlignment="Center">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0">
- <Border.BorderBrush>
- <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
- </Border.BorderBrush>
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </StackPanel>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB">
- <Setter Property="Content">
- <Setter.Value>
- <StackPanel Orientation="Horizontal">
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF6F6F">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#92FF92">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" CornerRadius="5" Margin="0 0 0 5" Padding="10" Background="Transparent" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop">
+ <Border.Style>
+ <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}">
+ <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
+ <Setter Property="Background" Value="White"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
+ <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
+ <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Border.Style>
+ <Grid>
+ <DockPanel>
+ <ContentControl DockPanel.Dock="Left">
+ <ContentControl.Style>
+ <Style TargetType="ContentControl">
+ <Setter Property="Content">
+ <Setter.Value>
+ <Rectangle/>
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel VerticalAlignment="Center">
+ <ItemsControl ItemsSource="{Binding InkVolumes}" VerticalAlignment="Center">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0">
+ <Border.BorderBrush>
+ <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
+ </Border.BorderBrush>
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel Orientation="Horizontal">
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF6F6F">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#3C7EF4">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#92FF92">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
- </StackPanel>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK">
- <Setter Property="Content">
- <Setter.Value>
- <StackPanel Orientation="Horizontal">
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Cyan">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#3C7EF4">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Magenta">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel Orientation="Horizontal">
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Cyan">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Yellow">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Magenta">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Black">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Yellow">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
- <Rectangle.Fill>
- <SolidColorBrush Color="{Binding Color}">
- </SolidColorBrush>
- </Rectangle.Fill>
- </Rectangle>
- </StackPanel>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB">
- <Setter Property="Content">
- <Setter.Value>
- <StackPanel Orientation="Horizontal">
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Gray">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Black">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF8A8A">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
+ <Rectangle.Fill>
+ <SolidColorBrush Color="{Binding Color}">
+ </SolidColorBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel Orientation="Horizontal">
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Gray">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FFFF8A">
- <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
- <mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
- </mahapps:NumericUpDown.Resources>
- </mahapps:NumericUpDown>
- </Border>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF8A8A">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
- <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
- <Rectangle.Fill>
- <SolidColorBrush Color="{Binding Color}">
- </SolidColorBrush>
- </Rectangle.Fill>
- </Rectangle>
- </StackPanel>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ContentControl.Style>
- </ContentControl>
+ <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FFFF8A">
+ <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown.Resources>
+ <Style TargetType="TextBox"/>
+ </mahapps:NumericUpDown.Resources>
+ </mahapps:NumericUpDown>
+ </Border>
+
+ <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
+ <Rectangle.Fill>
+ <SolidColorBrush Color="{Binding Color}">
+ </SolidColorBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ContentControl.Style>
+ </ContentControl>
- <Grid DockPanel.Dock="Right">
- <Border Style="{StaticResource JobFieldBorder}">
- <StackPanel Margin="5" Width="140">
- <StackPanel Orientation="Horizontal">
- <Image Source="../Images/colorspace.png" Width="24"></Image>
- <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock>
- </StackPanel>
- <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox>
+ <Grid DockPanel.Dock="Right">
+ <Border Style="{StaticResource JobFieldBorder}">
+ <StackPanel Margin="5" Width="140">
+ <StackPanel Orientation="Horizontal">
+ <Image Source="../Images/colorspace.png" Width="24"></Image>
+ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock>
</StackPanel>
- </Border>
- </Grid>
- <Grid>
- <StackPanel VerticalAlignment="Center">
- <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center"><Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> <Run FontFamily="digital-7" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run></TextBlock>
- <Slider ValueChanged="Offset_Slider_ValueChanged" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Minimum="0" Maximum="100" Value="{Binding OffsetPercent}"></Slider>
+ <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox>
</StackPanel>
- </Grid>
- </DockPanel>
- </Grid>
- </Border>
-
+ </Border>
+ </Grid>
+ <Grid>
+ <StackPanel VerticalAlignment="Center">
+ <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center"><Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> <Run FontFamily="digital-7" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run></TextBlock>
+ <Slider ValueChanged="Offset_Slider_ValueChanged" IsSnapToTickEnabled="True" TickFrequency="1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Value="{Binding OffsetPercent}">
+ <Slider.Minimum>
+ <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min">
+ <Binding Path="."></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
+ <Binding Path="StopIndex"></Binding>
+ </MultiBinding>
+ </Slider.Minimum>
+ <Slider.Maximum>
+ <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max">
+ <Binding Path="."></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
+ </MultiBinding>
+ </Slider.Maximum>
+ </Slider>
+ </StackPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
+ </Border>
+
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>