aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.DataSynchronizer.CLI/packages.config
blob: b3daf0d6cedea8f07fbc879c0d983021145335af (plain)
1
2
3
4
<UserControl x:Class="Tango.PPC.Jobs.Views.JobEurekaView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:Tango.PPC.Jobs.ViewModels"
             xmlns:model="clr-namespace:Tango.PPC.Jobs.Models"
             xmlns:helpers="clr-namespace:Tango.PPC.Jobs.Helpers"
             xmlns:fa="http://schemas.fontawesome.io/icons/"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
             xmlns:global="clr-namespace:Tango.PPC.Jobs"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:localConverters="clr-namespace:Tango.PPC.Jobs.Converters"
             xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
             xmlns:localControls="clr-namespace:Tango.PPC.Jobs.Controls"
             xmlns:components="clr-namespace:Tango.Touch.Components;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.Jobs.Views"
             mc:Ignorable="d" 
             d:DesignHeight="2000" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobViewVM}" x:Name="view">

    <UserControl.Resources>

        <localConverters:ColorSpaceToVisibilityConverter x:Key="ColorSpaceToVisibilityConverter" />
        <localConverters:JobToEmbroideryImageConverter x:Key="JobToEmbroideryImageConverter" />
        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter"/>
        <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter"/>
        <converters:TimeSpanToMinutesConverter x:Key="TimeSpanToMinutesConverter"/>
        <converters:TimeSpanToTwoDigitsTimeConverter x:Key="TimeSpanToTwoDigitsTimeConverter"/>
        <converters:TimeSpanToLabelConverter x:Key="TimeSpanToLabelConverter"/>
        <localConverters:MarginOffsetSliderConverter x:Key="MarginOffsetSliderConverter"/>
        <localConverters:FirstValueCollectionConverter x:Key="FirstValueCollectionConverter"/>
        <localConverters:LengthToWeightConverter x:Key="LengthToWeightConverter"/>

        <BitmapImage x:Key="Image_Out_Of_Gamut" UriSource="../Images/JobView/error.png" />
        <BitmapImage x:Key="Image_Replace_Color" UriSource="../Images/JobView/replace-color.png" />
        <BitmapImage x:Key="Image_Color_Picker" UriSource="../Images/JobView/color-picker.png" />
        <BitmapImage x:Key="Image_Transparent" UriSource="../Images/JobView/transparent.jpg" />
        <BitmapImage x:Key="Image_TransparentSmall" UriSource="../Images/JobView/transparent_small.jpg" />


        <Style TargetType="FrameworkElement" x:Key="Level1Container">
            <Setter Property="Margin" Value="20 15 60 15"></Setter>
        </Style>
        <Style TargetType="FrameworkElement" x:Key="Level2Container">
            <Setter Property="Margin" Value="80 30 60 0"></Setter>
        </Style>
        <Style TargetType="FrameworkElement" x:Key="Level2ContainerExtraMargin">
            <Setter Property="Margin" Value="80 40 60 0"></Setter>
        </Style>
                                            
        <Style x:Key="CollapsedPanelButton" TargetType="{x:Type touch:TouchButton}">
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="Foreground" Value="{StaticResource TangoMidAccentBrush}"></Setter>
            <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
            <Setter Property="MinHeight" Value="50"/>
            <Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
            <Setter Property="BorderThickness" Value="0"></Setter>
            <Setter Property="EnableDropShadow" Value="False"></Setter>
            <Setter Property="Padding" Value="4"></Setter>
            <Setter Property="VerticalAlignment" Value="Center"></Setter>
            <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" Value=".5"/>
                </Trigger>
                <DataTrigger Binding="{Binding JobModel.HasSelectedItems}" Value="false">
                    <Setter Property="Opacity" Value=".5"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="SliderGreyTextStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource TangoGrayTextBrush}"></Setter>
            <Setter Property="FontSize" Value="{StaticResource TangoSmallFontSize}"></Setter>
            <Setter Property="VerticalAlignment" Value="Center"></Setter>
            <Setter Property="HorizontalAlignment" Value="Center"></Setter>
        </Style>

        <Style x:Key="TouchButtonWithDisableState" TargetType="{x:Type touch:TouchButton}">
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
            <Setter Property="BorderThickness" Value="0"></Setter>
            <Setter Property="EnableDropShadow" Value="False"></Setter>
            <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <DataTemplate x:Key="HSB_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="3">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="H" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42" Height="29" >
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Hue, StringFormat=0.0}"></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock Text="S" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42" Height="29">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Saturation, StringFormat=0.0}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock Text="B" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42" Height="29">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Brightness, StringFormat=0.0}"></TextBlock>
                    </Border>
                </StackPanel>
            </UniformGrid>

        </DataTemplate>

        <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="3" Height="30" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="R" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border  Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchColor.R}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="4 0 0 0">
                    <TextBlock  Text="G" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchColor.G}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="4 0 0 0">
                    <TextBlock  Text="B" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="42">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchColor.B}" ></TextBlock>
                    </Border>
                </StackPanel>
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="CMYK_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="4" Height="30" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="C" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border  Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="48">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Cyan, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                    <TextBlock  Text="M" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="48">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Magenta, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock  Text="Y" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="48">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Yellow, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock  Text="K" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="48">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Black, StringFormat=0.##}"></TextBlock>
                    </Border>
                </StackPanel>
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="LAB_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="3" Height="30" MinWidth="150">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="L" FontSize="{StaticResource TangoSmallFontSize}" VerticalAlignment="Center"/>
                    <Border  Margin="10 0 0 0" Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="52">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchL, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="5 0 0 0">
                    <TextBlock  Text="a" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="52">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchA, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock  Text="b" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" Width="52">
                        <TextBlock Style="{StaticResource SliderGreyTextStyle}" Text="{Binding BestMatchB, StringFormat=0.##}" ></TextBlock>
                    </Border>
                </StackPanel>
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="CATALOG_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="2" Height="30" MinWidth="150">
                <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                    <TextBlock  Text="Catalog:" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" MinWidth="42" MaxWidth="130">
                        <TextBlock Padding="4 0 4 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalog.Name}" ></TextBlock>
                    </Border>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                    <TextBlock  Text="Color:" FontSize="{StaticResource TangoSmallFontSize}"  VerticalAlignment="Center"/>
                    <Border Margin="10 0 0 0"  Background="Transparent" BorderBrush="{StaticResource TangoGrayBrush}"  BorderThickness="0.8" MinWidth="42">
                        <TextBlock Padding="4 0 4 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalogsItem.Name}" ></TextBlock>
                    </Border>
                </StackPanel>
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="Segment_Template" DataType="{x:Type model:SegmentModel}">
            <Grid Height="410" Margin="57 15 57 0">
            <!--<Grid Height="310" Margin="57 10 57 0">-->
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <!--<RowDefinition Height="10" />-->
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>

                <DockPanel x:Name="header">
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"  Height="60">
                        <touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center"   EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="24" Width="24"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/delete_segment.png"/>
                            </Border>
                        </touch:TouchButton>
                        <touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center" EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DuplicateSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="27" Width="23"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/duplicate.png"/>
                            </Border>
                        </touch:TouchButton>
                    </StackPanel>
                    <StackPanel Grid.Row="0" DockPanel.Dock="Left">
                        <StackPanel  Margin="0 0 0 0" Orientation="Horizontal" >
                            <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}">Segment #</controls:FastTextBlock>
                            <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding SegmentIndex,Mode=OneWay}"></controls:FastTextBlock>
                        </StackPanel>
                        <StackPanel  Margin="0 5 0 0" Orientation="Horizontal">
                            <controls:FastTextBlock VerticalAlignment="Center"   FontSize="18">
                                <controls:FastTextBlock.Style>
                                    <Style TargetType="controls:FastTextBlock">
                                        <Setter Property="Text" Value="Weight (g):" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView}" Value="False">
                                                <Setter Property="Text" Value="Length (m):" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </controls:FastTextBlock.Style>
                            </controls:FastTextBlock>

                            <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" 
                                                                                   Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
                                                                                   StringFormat="N1" AutoCalculateJogStep="False" 
                                                                                   HasDecimalPoint="True" Minimum="1" Maximum="1000000" 
                                                                                   KeyboardContainer="{Binding ElementName=Container}" 
                                                                                   FontSize="18" ValueChangedEnd="Length_ValueChanged" 
                                                                                   TextGotFocus="Length_BeforeChangeValue" RippleBrush="Transparent"/>
                            </Border>
                            <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" 
                                                                                   Value="{Binding Weight, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
                                                                                   StringFormat="0.0" AutoCalculateJogStep="False" 
                                                                                   HasDecimalPoint="True" Minimum="0" Maximum="100000" 
                                                                                   KeyboardContainer="{Binding ElementName=Container}" 
                                                                                   FontSize="18"  RippleBrush="Transparent"/>
                            </Border>
                        </StackPanel>
                    </StackPanel>

                </DockPanel>

                <Grid Grid.Row="1" x:Name="displayOffset" Margin="0 10 0 -11" Visibility="{Binding IsGradient, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Border x:Name="leftoffsetBorder" Visibility="{Binding IsGradient, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <TextBlock x:Name="leftoffsetLabel" HorizontalAlignment="Left" MaxWidth="80" Margin="0 0 10 0" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoNotificationBarMaskBrush}" Text="{Binding LeftOffsetLabel,Mode=OneWay}"/>

                        <Border.Margin>
                            <MultiBinding Converter="{StaticResource MarginOffsetSliderConverter}" ConverterParameter="1" Delay="200" Mode="OneWay">
                                <Binding ElementName="sliderOffset" Path="LowerValue" ></Binding>
                                <Binding ElementName="sliderOffset" Path="ActualWidth"></Binding>
                                <Binding ElementName="leftoffsetLabel" Path="ActualWidth"></Binding>
                                <Binding ElementName="middleoffsetBorder" Path="Margin.Left"></Binding>

                            </MultiBinding>
                        </Border.Margin>
                    </Border>
                    <Border x:Name="middleoffsetBorder">
                        <TextBlock x:Name="middleoffsetLabel" HorizontalAlignment="Left" MaxWidth="80" Margin="10 0 10 0" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoNotificationBarMaskBrush}" Text="{Binding MiddleOffsetLabel,Mode=OneWay}"/>

                        <Border.Margin>
                            <MultiBinding Converter="{StaticResource MarginOffsetSliderConverter}" ConverterParameter="2" Delay="200" Mode="OneWay">
                                <Binding ElementName="sliderOffset" Path="MiddleValue"></Binding>
                                <Binding ElementName="sliderOffset" Path="ActualWidth"></Binding>
                                <Binding ElementName="middleoffsetLabel" Path="ActualWidth"></Binding>
                                <Binding ElementName="leftoffsetLabel" Path="ActualWidth"></Binding>
                                <Binding ElementName="upperoffsetLabel" Path="ActualWidth"></Binding>
                            </MultiBinding>
                        </Border.Margin>
                    </Border>
                    <Border x:Name="rightoffsetBorder">
                        <TextBlock x:Name="upperoffsetLabel" HorizontalAlignment="Left" MaxWidth="80" Margin="0 0 0 0" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoNotificationBarMaskBrush}" Text="{Binding RightOffsetLabel,Mode=OneWay}"/>


                        <Border.Margin>
                            <MultiBinding Converter="{StaticResource MarginOffsetSliderConverter}" ConverterParameter="3" Delay="200" Mode="OneWay">
                                <Binding ElementName="sliderOffset" Path="UpperValue"></Binding>
                                <Binding ElementName="sliderOffset" Path="ActualWidth"></Binding>
                                <Binding ElementName="upperoffsetLabel" Path="ActualWidth"></Binding>
                                <Binding ElementName="middleoffsetBorder" Path="Margin.Left"></Binding>
                                <Binding ElementName="middleoffsetLabel" Path="ActualWidth"></Binding>
                            </MultiBinding>
                        </Border.Margin>
                    </Border>
                </Grid>

                <Border Grid.Row="2" x:Name="segmentBrush" Height="90" Margin="0 20 0 0" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">

                    <Border Background="{Binding SegmentBrush}" CornerRadius="20">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*"/>
                                <ColumnDefinition Width="1*"/>
                                <ColumnDefinition Width="1*"/>
                            </Grid.ColumnDefinitions>
                            <touch:TouchButton  Margin="26 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"  Command="{Binding ElementName=view,Path=DataContext.EditColorCommand}" CommandParameter="{Binding FirstBrushStop}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityConverter}}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0">
                                <Border  Height="40" Width="40"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                    <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/Edit_color.png"/>
                                </Border>
                            </touch:TouchButton>
                            <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <!--<touch:TouchIconButton   Command="{Binding ElementName=view,Path=DataContext.AddColorCommand}" CommandParameter="{Binding}"
                                    Height="40" Width="40"   Style="{StaticResource TangoRoundTouchIconButton}" Icon="Plus" Background="{StaticResource TangoRippleDarkBrush}" Foreground="{StaticResource TangoLightForegroundBrush}" Padding="12" Margin="20 0 0 0"  />-->
                                <touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center"  Command="{Binding ElementName=view,Path=DataContext.AddColorCommand}" CommandParameter="{Binding}"  EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" BorderBrush="Transparent" RippleBrush="Transparent" >
                                    <Border  Height="40" Width="40"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                        <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/AddColor.png"/>
                                    </Border>
                                </touch:TouchButton>
                                <TextBlock VerticalAlignment="Center" Margin="20 5 0 0"  FontSize="{StaticResource TangoSmallFontSize}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityInverseConverter}}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}">Add Color</TextBlock>
                            </StackPanel>
                            <touch:TouchButton Margin="0 0 26 0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center"  Command="{Binding ElementName=view,Path=DataContext.EditColorCommand}" CommandParameter="{Binding SecondBrushStop}" Visibility="{Binding IsGradient, Converter={StaticResource BooleanToVisibilityConverter}}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0">
                                <Border  Height="40" Width="40"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                    <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/Edit_color.png"/>
                                </Border>
                            </touch:TouchButton>
                           
                        </Grid>
                    </Border>
                </Border>
                <!--<Canvas Grid.Row="1"  x:Name="alert_canvas_segment" Width="30"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="-40 -10 0 0" >
                    <touch:TouchButton Height="22" Width="24" Canvas.Left="0" Canvas.Top="0" x:Name="addmyColors"  EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" Visibility="{Binding HasOutOfGamutBrush, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Border   BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                            <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/Exclamation_black.png"/>
                        </Border>
                    </touch:TouchButton>
                </Canvas>-->

                <Grid Grid.Row="3"  x:Name="sliderThreeThumbs" Visibility="{Binding IsGradient, Converter={StaticResource BooleanToVisibilityConverter}}" >
                    <touch:TouchSliderThreeThumbs x:Name="sliderOffset" Height="40" MinimumMiddleRange="5.0" Length="{Binding Length}" LowerValue="{Binding LeftOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MiddleValue="{Binding MiddleOffset, Mode=TwoWay}"  UpperValue="{Binding RightOffset, Mode=TwoWay}" 
                                                  LowerValueEndChanging ="{Binding LeftOffsetChangeComleted}" LowerValueStartChanging="{Binding LeftOffsetStartChanging}"
                                                  UpperValueStartChanging ="{Binding RightOffsetStartChanging}" UpperValueEndChanging="{Binding RightOffsetChangeComleted}"
                                                  MiddleValueStartChanging ="{Binding MiddleOffsetStartChanging}" MiddleValueEndChanging ="{Binding MiddleOffsetChangeComleted}"/>
                </Grid>

                <Grid  Grid.Row="4" Margin="0 10 0 0" x:Name="colorSpacesSegment" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="1*" MinWidth="10"/>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <ContentControl  x:Name="leftColorSpaceValues" Grid.Column="0" Focusable="False" Margin="0 0 0 0"  HorizontalAlignment="Left"  Content="{Binding FirstBrushStop}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <ContentControl.Style>
                            <Style TargetType="ContentControl">
                                <Setter Property="ContentTemplate">
                                    <Setter.Value>
                                        <DataTemplate/>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="HSB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource HSB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="RGB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="Volume">
                                        <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="LAB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="Catalog">
                                        <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ContentControl.Style>
                    </ContentControl>
                    <Border Grid.Column="1"></Border>
                    <ContentControl  x:Name="rightColorSpaceValues" Grid.Column="2"  Focusable="False" Margin="0 0 0 0"  HorizontalAlignment="Right" HorizontalContentAlignment="Right" 
                                                 Visibility="{Binding IsGradient, Converter={StaticResource BooleanToVisibilityConverter}}" Content="{Binding SecondBrushStop}">
                        <ContentControl.Style>
                            <Style TargetType="ContentControl">
                                <Setter Property="ContentTemplate">
                                    <Setter.Value>
                                        <DataTemplate/>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding SecondBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}, Mode=OneWay}" Value="HSB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource HSB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding SecondBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}, Mode=TwoWay}" Value="RGB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding SecondBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}, Mode=OneWay}" Value="Volume">
                                        <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding SecondBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}, Mode=OneWay}" Value="LAB">
                                        <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding SecondBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}, Mode=OneWay}" Value="Catalog">
                                        <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ContentControl.Style>
                    </ContentControl>
                   
                </Grid>
                <!--<Rectangle Grid.Row="5" Fill="{StaticResource TangoDividerBrush}" Height="2" VerticalAlignment="Bottom"  Margin="0 0 0 0"/>-->

                <Grid Grid.Row="5" x:Name="add_new_segment_gap"  HorizontalAlignment="Stretch"  Margin="0 30 0 0" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" />

                    <Border x:Name="gapBorder" Margin="0 0 0 0" Height="24"  ClipToBounds="False" CornerRadius="10" Visibility="{Binding ShowGap, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="10" RadiusY="10">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding ElementName="gapBorder" Path="ActualWidth"  />
                                        <Binding ElementName="gapBorder" Path="ActualHeight"  />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <Grid>
                            <TextBlock FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4">
                                        <Run Text="{Binding InterSegmentLength, Mode=OneWay}"></Run>
                                        <Run Text="m Gap"></Run>
                            </TextBlock>
                            <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="12" RadiusY="12" />
                        </Grid>
                    </Border>

                    <DockPanel Margin="0 10 0 0" Grid.Row="1">
                        <!--<Grid DockPanel.Dock="Right" Visibility="{Binding IsLast, Converter={StaticResource BooleanToVisibilityInverseConverter}}">-->
                        <Grid DockPanel.Dock="Right" Visibility="Collapsed">
                            <touch:TouchButton x:Name="deletegap"  DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding DeleteGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityConverter}}">
                                <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Delete Gap</TextBlock>
                            </touch:TouchButton>
                            <touch:TouchButton x:Name="addGap"  DockPanel.Dock="Right" HorizontalAlignment="Left" VerticalAlignment="Center"  Command="{Binding AddGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                <StackPanel Orientation="Horizontal">
                                    <Border Height="35" Width="35"  BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
                                        <Image Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/add_gap.png"/>
                                    </Border>
                                    <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Add Gap</TextBlock>
                                </StackPanel>
                            </touch:TouchButton>
                        </Grid>
                        <touch:TouchButton DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center"  Command="{Binding DataContext.AddNewSegmentCommand, ElementName=listSegments}" CommandParameter="{Binding }" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0">
                            <StackPanel Orientation="Horizontal">
                                <Border Height="35" Width="35"  BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
                                    <Image Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/AddNewSegment.png"/>
                                </Border>
                                <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Add New Segments</TextBlock>
                            </StackPanel>
                        </touch:TouchButton>
                    </DockPanel>

                    <Rectangle Margin="0 10 0 0" Grid.Row="2" Stroke="{StaticResource TangoDividerBrush}"  StrokeThickness="1"  VerticalAlignment="Bottom"/>
                </Grid>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="GroupSegment_Template" DataType="{x:Type model:SegmentsGroupModel}">
            <!--<Grid Height="310" Margin="57 10 57 0">-->
            <Grid Height="400" Margin="57 15 57 0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                    <!--<RowDefinition Height="10" />-->
                </Grid.RowDefinitions>

                <DockPanel>
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"  Height="60">
                        <touch:TouchButton Background="Transparent" Foreground="{StaticResource TangoPrimaryAccentBrush}" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.UngroupSegmentsCommand}" CommandParameter="{Binding}">
                            <TextBlock FontSize="{StaticResource TangoButtonFontSize}"  TextDecorations="Underline" Text="Ungroup" />
                        </touch:TouchButton>
                        <touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center"   EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DeleteSegmentsGroupCommand}" CommandParameter="{Binding}">
                            <Border  Height="24" Width="24"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/delete_segment.png"/>
                            </Border>
                        </touch:TouchButton>
                        <!--<touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center" EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DuplicateSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="24" Width="24"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/duplicate.png"/>
                            </Border>
                        </touch:TouchButton>-->
                    </StackPanel>
                    <StackPanel Grid.Row="0" DockPanel.Dock="Left">
                        <StackPanel  Margin="0 0 0 0" Orientation="Horizontal" >
                            <TextBlock FontSize="{StaticResource TangoTitleFontSize}">
                                <Run>Group #</Run>
                                <Run Text="{Binding SegmentIndex, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
                                
                            </TextBlock>
                            <touch:TouchButton Background="Transparent" Width="Auto" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.RepeatSegmentsGroupCommand}" CommandParameter="{Binding}">
                                <TextBlock Margin="10 0 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" TextDecorations="Underline">
                                    <Run>x</Run>
                                    <Run Text="{Binding Repeats, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
                                </TextBlock>
                            </touch:TouchButton>
                        </StackPanel>
                        <StackPanel  Margin="0 0 0 0" Orientation="Horizontal">
                            <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):" FontSize="18"></controls:FastTextBlock>
                            <controls:FastTextBlock Margin="20 0 0 0" Width="92" VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="{Binding Length}" FontSize="18"></controls:FastTextBlock>
                        </StackPanel>
                    </StackPanel>
                </DockPanel>

                <Border Grid.Row="1"  x:Name="brush_border" Height="90" Margin="0 20 0 0" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">
                    <Border.Clip>
                        <RectangleGeometry RadiusX="25" RadiusY="25">
                            <RectangleGeometry.Rect>
                                <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                    <Binding ElementName="brush_border" Path="ActualWidth"  />
                                    <Binding ElementName="brush_border" Path="ActualHeight"  />
                                </MultiBinding>
                            </RectangleGeometry.Rect>
                        </RectangleGeometry>
                    </Border.Clip>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.Width>
                                            <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
                                                <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="DataContext.Length"></Binding>
                                                <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                                <Binding Path="Length"></Binding>
                                            </MultiBinding>
                                        </Grid.Width>
                                        <Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>

                        <Border  Height="40" Width="151"  Opacity="1" Background="#32787880" HorizontalAlignment="Center" CornerRadius="8" VerticalAlignment="Center">
                            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}"> Grouped</TextBlock>
                        </Border>
                    </Grid>
                </Border>
                <!--<Rectangle Grid.Row="2" Fill="{StaticResource TangoDividerBrush}" Height="2" VerticalAlignment="Bottom"  Margin="0 0 0 0"/>-->

                <Grid Grid.Row="2" x:Name="add_new_segment_gap"  HorizontalAlignment="Stretch"  Margin="0 30 0 0" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" />

                    <Border x:Name="gapBorder" Margin="0 0 0 0" Height="24"  ClipToBounds="False" CornerRadius="10" Visibility="{Binding ShowGap, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="10" RadiusY="10">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding ElementName="gapBorder" Path="ActualWidth"  />
                                        <Binding ElementName="gapBorder" Path="ActualHeight"  />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <Grid>
                            <TextBlock FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4">
                                        <Run Text="{Binding InterSegmentLength, Mode=OneWay}"></Run>
                                        <Run Text="m Gap"></Run>
                            </TextBlock>
                            <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="12" RadiusY="12" />
                        </Grid>
                    </Border>

                    <DockPanel Margin="0 10 0 0" Grid.Row="1">
                        <!--<Grid DockPanel.Dock="Right" Visibility="{Binding IsLast, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                        <Grid DockPanel.Dock="Right" Visibility="Collapsed">
                            <touch:TouchButton x:Name="deletegap"  DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding DeleteGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityConverter}}">
                                <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Delete Gap</TextBlock>
                            </touch:TouchButton>
                            <touch:TouchButton x:Name="addGap"  DockPanel.Dock="Right" HorizontalAlignment="Left" VerticalAlignment="Center"  Command="{Binding AddGapCommand}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" Visibility="{Binding EnableInterSegment, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                <StackPanel Orientation="Horizontal">
                                    <Border Height="35" Width="35"  BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
                                        <Image Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/add_gap.png"/>
                                    </Border>
                                    <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Add Gap</TextBlock>
                                </StackPanel>
                            </touch:TouchButton>
                        </Grid>-->
                        <touch:TouchButton DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center"  Command="{Binding DataContext.AddNewSegmentCommand, ElementName=listSegments}" CommandParameter="{Binding }" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0">
                            <StackPanel Orientation="Horizontal">
                                <Border Height="35" Width="35"  BorderThickness="0" Background="Transparent" HorizontalAlignment="Left">
                                    <Image Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/AddNewSegment.png"/>
                                </Border>
                                <TextBlock Margin="10 2 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center">Add New Segments</TextBlock>
                            </StackPanel>
                        </touch:TouchButton>
                    </DockPanel>

                    <Rectangle Margin="0 10 0 0" Grid.Row="2" Stroke="{StaticResource TangoDividerBrush}"  StrokeThickness="1"  VerticalAlignment="Bottom"/>
                </Grid>

                <Rectangle Margin="0 10 0 0" Grid.Row="2" Stroke="{StaticResource TangoDividerBrush}"  StrokeThickness="1"  VerticalAlignment="Bottom"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="CollapsedSegment_Template" DataType="{x:Type model:SegmentModel}">
            <Grid Height="180" Margin="57 15 57 0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <DockPanel>
                    <Rectangle DockPanel.Dock="Top" Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" Margin="0 0 0 10"/>
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"  Height="40">
                        <touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center"   EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="24" Width="24"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/delete_segment.png"/>
                            </Border>
                        </touch:TouchButton>
                        <touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center" EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DuplicateSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="27" Width="23"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/duplicate.png"/>
                            </Border>
                        </touch:TouchButton>
                    </StackPanel>
                    <StackPanel DockPanel.Dock="Left">
                        <StackPanel  Margin="0 10 0 0" Orientation="Horizontal" >
                            <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}">Segment #</controls:FastTextBlock>
                            <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding SegmentIndex,Mode=OneWay}"></controls:FastTextBlock>
                        </StackPanel>
                    </StackPanel>
                </DockPanel>

                <StackPanel Grid.Row="1" Orientation="Vertical">
                    <Border  Height="50" x:Name="segmentBrush" Margin="0 11 0 0" CornerRadius="25" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">
                        <Border Background="{Binding SegmentBrush}" CornerRadius="25"  />
                    </Border>
                    <Border x:Name="gapBorder" Margin="0 20 0 0" Height="24"  ClipToBounds="False" CornerRadius="10" Visibility="{Binding ShowGap, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="10" RadiusY="10">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding ElementName="gapBorder" Path="ActualWidth"  />
                                        <Binding ElementName="gapBorder" Path="ActualHeight"  />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <Grid>
                            <TextBlock FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4">
                                        <Run Text="{Binding InterSegmentLength, Mode=OneWay}"></Run>
                                        <Run Text="m Gap"></Run>
                            </TextBlock>
                            <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="12" RadiusY="12" />
                        </Grid>
                    </Border>

                </StackPanel>

                <Canvas Grid.Row="1"  x:Name="select_canvas_segment" Width="24"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="-50 -35 0 0" >
                    <touch:TouchCheckBox Height="22" Width="24" Margin="20 -20 0 0" Style="{StaticResource TouchRoundCheckBox}"  Canvas.Left="0" Canvas.Top="0" x:Name="selectItem" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                </Canvas>

            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="CollapsedGroupSegment_Template" DataType="{x:Type model:SegmentsGroupModel}">
            <Grid Height="180" Margin="57 15 57 0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <DockPanel>
                    <Rectangle DockPanel.Dock="Top" Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" Margin="0 0 0 10"/>
                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"  Height="40">
                        <touch:TouchButton Background="Transparent" Foreground="{StaticResource TangoPrimaryAccentBrush}" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.UngroupSegmentsCommand}" CommandParameter="{Binding}">
                            <TextBlock FontSize="{StaticResource TangoButtonFontSize}"  TextDecorations="Underline" Text="Ungroup" />
                        </touch:TouchButton>
                        <touch:TouchButton Margin="10 0 0 0" VerticalAlignment="Center"   EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DeleteSegmentsGroupCommand}" CommandParameter="{Binding}">
                            <Border  Height="24" Width="24"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/delete_segment.png"/>
                            </Border>
                        </touch:TouchButton>
                        <!--<touch:TouchButton Margin="20 0 0 0" VerticalAlignment="Center" EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding ElementName=view,Path=DataContext.DuplicateSegmentCommand}" CommandParameter="{Binding}">
                            <Border  Height="27" Width="23"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/duplicate.png"/>
                            </Border>
                        </touch:TouchButton>-->
                    </StackPanel>
                    <StackPanel DockPanel.Dock="Left">
                        <StackPanel  Margin="0 10 0 0" Orientation="Horizontal" >
                            <TextBlock FontSize="{StaticResource TangoTitleFontSize}">
                                <Run>Group #</Run>
                                <Run Text="{Binding SegmentIndex, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
                            </TextBlock>
                            <touch:TouchButton Margin="10 0 0 0" Background="Transparent" Width="Auto" EnableDropShadow="False" Command="{Binding ElementName=view,Path=DataContext.RepeatSegmentsGroupCommand}" CommandParameter="{Binding}">
                                <TextBlock Foreground="{StaticResource TangoPrimaryAccentBrush}" TextDecorations="Underline">
                                    <Run>x</Run>
                                    <Run Text="{Binding Repeats, Mode=OneWay,IsAsync=True,FallbackValue='0000'}"></Run>
                                </TextBlock>
                            </touch:TouchButton>
                        </StackPanel>
                    </StackPanel>
                </DockPanel>

                <StackPanel Grid.Row="1" Orientation="Vertical">
                    <Border  Height="50" x:Name="brush_border" Margin="0 10 0 0" CornerRadius="25" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}" ClipToBounds="False">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="25" RadiusY="25">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding ElementName="brush_border" Path="ActualWidth"  />
                                        <Binding ElementName="brush_border" Path="ActualHeight"  />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <ItemsControl ClipToBounds="False" ItemsSource="{Binding Segments}" >
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.Width>
                                                <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
                                                    <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="DataContext.Length"></Binding>
                                                    <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                                    <Binding Path="Length"></Binding>
                                                </MultiBinding>
                                            </Grid.Width>
                                            <Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>

                            <Border  Height="28" Width="150"  BorderThickness="0" BorderBrush="Transparent" Opacity="20" Background="#32787880" HorizontalAlignment="Center" CornerRadius="8" VerticalAlignment="Center">
                                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoComboBoxItemFontSize}"> Grouped</TextBlock>
                            </Border>

                        </Grid>

                    </Border>
                    <Border x:Name="gapBorder" Margin="0 20 0 0" Height="24"  ClipToBounds="False" CornerRadius="10" Visibility="{Binding ShowGap, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="10" RadiusY="10">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding ElementName="gapBorder" Path="ActualWidth"  />
                                        <Binding ElementName="gapBorder" Path="ActualHeight"  />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <Grid>
                            <TextBlock FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4">
                                        <Run Text="{Binding InterSegmentLength, Mode=OneWay}"></Run>
                                        <Run Text="m Gap"></Run>
                            </TextBlock>
                            <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="12" RadiusY="12" />
                        </Grid>
                    </Border>

                </StackPanel>

                <Canvas Grid.Row="1"  x:Name="select_canvas_segment" Width="24"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="-50 -35 0 0" >
                    <touch:TouchCheckBox Height="22" Width="24" Margin="20 -20 0 0" Style="{StaticResource TouchRoundCheckBox}"  Canvas.Left="0" Canvas.Top="0" x:Name="selectItem" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                </Canvas>

            </Grid>
        </DataTemplate>

        <helpers:GroupSegmentTemplateSelector x:Key="GroupSegmentTemplateSelector" 
                                         GroupSegmentsTemplate="{StaticResource GroupSegment_Template}"
                                         SegmentTemplate="{StaticResource Segment_Template}"/>
        <helpers:GroupSegmentTemplateSelector x:Key="CollapsedGroupSegmentTemplateSelector" 
                                         GroupSegmentsTemplate="{StaticResource CollapsedGroupSegment_Template}"
                                         SegmentTemplate="{StaticResource CollapsedSegment_Template}"/>

    </UserControl.Resources>

    <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <touch:TouchLoadingPanel x:Name="GeneralSettings" Grid.Row="1" IsLoading="{Binding IsBusy}"  Margin="10 7 10 0" IsEnabled="{Binding CanEdit}">
            <Border Grid.Row="1" x:Name="jobDetailsBorder"  Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="2" BorderBrush="{StaticResource TangoLightBorderBrush}"  Margin="0 7 0 7">

            <Grid  x:Name="job_details" HorizontalAlignment="Stretch" >
                   
                    <StackPanel Orientation="Vertical">
                        <DockPanel>
                            <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center"  Width="200" MinHeight="55" HorizontalAlignment="Right" Margin="0 0 0 0">
                                <touch:TouchToggleSlider Style="{StaticResource TouchToggleButtonSlider}" Background="{StaticResource TangoMidBackgroundBrush}" CheckedBackground="{StaticResource TangoMidBackgroundBrush}" UncheckedBackground="{StaticResource TangoMidBackgroundBrush}"  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="20 0 110 0"  CornerRadius="17" Height="34" Width="164" ThumbWidth="80" LeftText="Length" RightText="Weight" ThumbCornerRadius="13" IsChecked="{Binding IsWeightView}" ></touch:TouchToggleSlider>
                            </StackPanel>
                            <StackPanel   Orientation="Horizontal" MinHeight="55" VerticalAlignment="Top" >
                            <StackPanel.Style>
                                <Style TargetType="StackPanel">
                                    <Setter Property="Margin" Value="20 10 10 0"></Setter>
                                    <!--<Style.Triggers>
                                        <DataTrigger Binding="{Binding IsFullMode}" Value="false">
                                            <Setter Property="Margin" Value="20 15 60 15"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>-->
                                </Style>
                            </StackPanel.Style>
                            <Image Source="../Images/JobView/job-details.png" Width="30" Height="30" />
                            <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">General Settings</TextBlock>
                        </StackPanel> 
                         
                        </DockPanel>
                        
                        <Rectangle Height="2" Margin="0 0 0 0" Fill="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom"></Rectangle>
                        
                    <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                            <DockPanel  HorizontalAlignment="Stretch" Margin="60 20 60 0">
                                <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="Thread" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
                                <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}">
                                <touch:TouchComboBox Margin="20 0 10 10" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML ,Mode=TwoWay}" Focusable="False" KeyboardNavigation.TabNavigation ="None">
                                        <touch:TouchComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Margin="20 10 10 10" TextTrimming="CharacterEllipsis" FontSize="{StaticResource TangoComboBoxItemFontSize}" Text="{Binding FinalName}"/>
                                            </DataTemplate>
                                        </touch:TouchComboBox.ItemTemplate>
                                        <touch:TouchComboBox.SelectedItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Margin="0 0 0 5" FontSize="{StaticResource TangoComboBoxItemFontSize}" Text="{Binding FinalName}" VerticalAlignment="Center"></TextBlock>
                                            </DataTemplate>
                                        </touch:TouchComboBox.SelectedItemTemplate>
                                    </touch:TouchComboBox>
                                </Border>
                            </DockPanel>
                      </StackPanel>
                        <DockPanel HorizontalAlignment="Stretch" Margin="60 20 60 20"> 
                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
                                <TextBlock HorizontalAlignment="Left" Margin="20 10 0 0" Text="Divided By Spools" FontSize="{StaticResource TangoButtonFontSize}" Width="Auto"/>
                                <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120" DockPanel.Dock="Right">
                                    <touch:TouchNumericTextBox BorderBrush="Transparent"  Margin="0 0 0 0" HasDecimalPoint="False" Minimum="4" Step="4"  FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.NumberSpools}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>
                                </Border>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="Copies" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
                                <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120">
                                    <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="4" Maximum="1000000"  Step="4" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.Copies}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>

                                </Border>
                            </StackPanel>
                           
                        </DockPanel>
                        <StackPanel Orientation="Horizontal" Margin="60 0 60 20" Visibility="{Binding IsBasicMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                            <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="White Gap(m)" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
                            <Border Margin="20 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120">
                                <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="0" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.InterSegmentLength}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>

                            </Border>
                        </StackPanel>
                    </StackPanel>

                    <!--<touch:TouchButton  Margin="0 0 30 0"  VerticalAlignment="Center" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"   EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding EditJobDetailsCommand}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" 
                                    components:TransformationHelper.TransformWhenPressed ="False">

                    <Grid  VerticalAlignment="Center" HorizontalAlignment="Stretch" Background="Transparent">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"/>
                            <ColumnDefinition Width="auto" MaxWidth="320"/>
                            <ColumnDefinition Width="auto" MaxWidth="320"/>
                            <ColumnDefinition Width="40"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Visibility="Hidden" Margin="16 0 0 5" TextTrimming="CharacterEllipsis" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="SemiBold" FontSize="{StaticResource TangoMessageBoxTitleFontSize}"  Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}"/>

                        <StackPanel Margin="10 0 0 0" Grid.Column="1" VerticalAlignment="Center"  Orientation="Horizontal" HorizontalAlignment="Left">
                            <StackPanel.ToolTip>
                                <ToolTip>
                                    <TextBlock Text="{Binding JobModel.Rml.Name}" />
                                </ToolTip>
                            </StackPanel.ToolTip>
                            <TextBlock Text="Thread Type:" VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" ></TextBlock>
                            <TextBlock Margin="5 0 0 0"   VerticalAlignment="Center"  TextTrimming="CharacterEllipsis" FontSize="{StaticResource TangoDefaultFontSize}" Text="{Binding JobModel.Rml.FinalName}"/>
                        </StackPanel>

                        <StackPanel Margin="30 0 0 0" Grid.Column="2" VerticalAlignment="Center"  Orientation="Horizontal" HorizontalAlignment="Center">
                            <StackPanel.ToolTip>
                                <ToolTip>
                                    <TextBlock Text="{Binding JobModel.SpoolTypeName}" />
                                </ToolTip>
                            </StackPanel.ToolTip>
                            <TextBlock Text="Spool Type:" VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}" ></TextBlock>
                            <TextBlock Text="{Binding JobModel.SpoolTypeName}" Margin="5 0 0 0"   VerticalAlignment="Center"  TextTrimming="CharacterEllipsis" FontSize="{StaticResource TangoDefaultFontSize}"/>
                        </StackPanel>

                       
                    </Grid>
                </touch:TouchButton>-->

            </Grid>
               
            </Border>
               
        </touch:TouchLoadingPanel>
        <touch:TouchLoadingPanel Grid.Row="2" IsLoading="{Binding IsBusy}" IsEnabled="{Binding CanEdit}">
            <Grid  >
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Grid Grid.Row="0" x:Name="segmentsGrid" Grid.RowSpan="3" >
                    <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Margin="0 0 0 0" Background="{StaticResource TangoMidBackgroundBrush}">
                        <touch:TouchDropShadowBorder Margin="10 0 10 0" Padding="0 0 0 0" >
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="1*"/>
                                    <RowDefinition Height="100"/>
                                </Grid.RowDefinitions>
                                <Grid Grid.Row="0">
                                    <DockPanel x:Name="ColorPropertiesPanel" VerticalAlignment="Top" >
                                        <StackPanel x:Name="AdvansedOptions" DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Top" Margin="0 5 18 0" Height="55" HorizontalAlignment="Right" Width="Auto" Visibility="{Binding ShowAdvanced, Converter={StaticResource BooleanToVisibilityConverter}}">
                                            <TextBlock FontSize="20" VerticalAlignment="Center" >Advanced Options</TextBlock>
                                            <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGreenAccent}" Height="28" CornerRadius="14"  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10 0 0 0" Width="54" IsChecked="{Binding IsBasicMode, Converter={StaticResource BooleanInverseConverter}, Mode=TwoWay}"></touch:TouchToggleSlider>
                                        </StackPanel>
                                        <DockPanel DockPanel.Dock="Left">
                                            <StackPanel x:Name="colorAndLength" DockPanel.Dock="Top"  Orientation="Horizontal" VerticalAlignment="Center">
                                                <StackPanel.Style>
                                                    <Style TargetType="StackPanel">
                                                        <Setter Property="Margin" Value="20 25 10 15"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding IsFullMode}" Value="false">
                                                                <Setter Property="Margin" Value="20 15 60 15"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </StackPanel.Style>
                                                <Image Source="../Images/JobView/color-length.png" Width="30" />
                                                <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Copy Properties</TextBlock>
                                            </StackPanel>
                                            <touch:TouchCheckBox x:Name="selectAll" Width="120" Height="22"  Style="{StaticResource TouchRoundCheckBox}" Margin="28 0 0 20"  IsChecked="{Binding JobModel.SelectAllSegments}" DockPanel.Dock="Top" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" Visibility="{Binding IsFullMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                                <TextBlock FontSize="{StaticResource TangoButtonFontSize}" Foreground="{StaticResource TangoMidAccentBrush}"> Select All</TextBlock>
                                            </touch:TouchCheckBox>
                                        </DockPanel>
                                    </DockPanel>
                                    <Rectangle Height="2" Margin="0 0 0 0" Fill="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom"></Rectangle>
                                </Grid>
                                <Grid  Grid.Row="1" Margin="0 4 0 0" Visibility="{Binding IsBasicMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                    <!--Border x:Name="borderDockFloat" Height="10" Margin="0 0 0 0" BorderBrush="Transparent" >
                                        <DockPanel x:Name="dockEdit" LastChildFill="False"  Height="10" Width="50" HorizontalAlignment="Right" RenderTransformOrigin="0.58,2.08"/>
                                        </Border> -->
                                    <ListBox x:Name="listSegments"  Margin="10 0 10 20" Padding="0" BorderThickness="0"  ItemsSource="{Binding SegmentsCollectionView}" ItemTemplateSelector="{StaticResource GroupSegmentTemplateSelector}" Style="{StaticResource SegmentsListBox}" 
                                             ScrollViewer.VerticalScrollBarVisibility="Visible" 
                                             Visibility="{Binding IsFullMode, Converter={StaticResource BooleanToVisibilityConverter}}"/>


                                    <ListBox  x:Name="collapsedListSegments" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplateSelector ="{StaticResource CollapsedGroupSegmentTemplateSelector}" Style="{StaticResource SegmentsListBox}" 
                                                  ScrollViewer.VerticalScrollBarVisibility="Visible" 
                                                  Visibility="{Binding IsFullMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin=" 0 0 0 100"/>

                                        <!--<StackPanel x:Name="stackOutput"  Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}"/>-->

                                </Grid>
                                <Grid  Grid.Row="1" Margin="0 4 0 0" Visibility="{Binding IsBasicMode, Converter={StaticResource BooleanToVisibilityConverter}}" >

                                    <Grid Height="Auto" Margin="57 15 57 0" DataContext="{Binding JobModel.Segments, Converter={StaticResource FirstValueCollectionConverter}}">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>

                                        <Grid x:Name="header" HorizontalAlignment="Stretch" Margin="0 10 0 0">
                                            <controls:FastTextBlock VerticalAlignment="Center" DockPanel.Dock="Left"  FontSize="{StaticResource TangoButtonFontSize}" Width="120" HorizontalAlignment="Left">
                                                <controls:FastTextBlock.Style>
                                                    <Style TargetType="controls:FastTextBlock">
                                                        <Setter Property="Text" Value="Weight (g):" />
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView}" Value="False">
                                                                <Setter Property="Text" Value="Length (m):" />
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </controls:FastTextBlock.Style>
                                            </controls:FastTextBlock>
                                            <Border Margin="140 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                                <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" 
                                                                                   Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
                                                                                   StringFormat='#,0.0' AutoCalculateJogStep="False" 
                                                                                   HasDecimalPoint="True" Minimum="1" Maximum="1000000" 
                                                                                   KeyboardContainer="{Binding ElementName=Container}" 
                                                                                   FontSize="18" ValueChangedEnd="Length_ValueChanged" 
                                                                                   TextGotFocus="Length_BeforeChangeValue" RippleBrush="Transparent"/>
                                                
                                            </Border>
                                            <Border Margin="140 0 0 0" BorderThickness="1"  Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Visibility="{Binding ElementName=segmentsGrid, Path=DataContext.IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                                <touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center" 
                                                                                   Value="{Binding Weight, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
                                                                                   StringFormat="#,0.0" AutoCalculateJogStep="False" 
                                                                                   HasDecimalPoint="True" Minimum="0" Maximum="100000" 
                                                                                   KeyboardContainer="{Binding ElementName=Container}" 
                                                                                   FontSize="18"  RippleBrush="Transparent"/>

                                            </Border>
                                        </Grid>

                                        <Border Grid.Row="1" x:Name="segmentBrush" Height="90" Margin="0 20 0 0" CornerRadius="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">

                                            <Border Background="{Binding SegmentBrush}" CornerRadius="20">
                                                <Grid>
                                                    <touch:TouchButton  Margin="26 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"  Command="{Binding ElementName=segmentsGrid,Path=DataContext.EditColorCommand}" CommandParameter="{Binding FirstBrushStop}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityConverter}}" EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0">
                                                        <Border  Height="40" Width="40"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                                            <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/Edit_color.png"/>
                                                        </Border>
                                                    </touch:TouchButton>
                                                    <StackPanel  Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                                                        <!--<touch:TouchIconButton   Command="{Binding ElementName=view,Path=DataContext.AddColorCommand}" CommandParameter="{Binding}"
                                        Height="40" Width="40"   Style="{StaticResource TangoRoundTouchIconButton}" Icon="Plus" Background="{StaticResource TangoRippleDarkBrush}" Foreground="{StaticResource TangoLightForegroundBrush}" Padding="12" Margin="20 0 0 0"  />-->
                                                        <touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center"  Command="{Binding ElementName=segmentsGrid,Path=DataContext.AddColorCommand}" CommandParameter="{Binding}"  EnableDropShadow="False" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"   Background="Transparent" BorderThickness="0" BorderBrush="Transparent" RippleBrush="Transparent"
                                                                               Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                                            <Border  Height="40" Width="40"  BorderThickness="0" BorderBrush="{StaticResource TangoKeyboardKeyDarkBrush}" Background="Transparent" HorizontalAlignment="Left">
                                                                <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/AddColor.png"/>
                                                            </Border>
                                                        </touch:TouchButton>
                                                        <TextBlock VerticalAlignment="Center" Margin="20 5 0 0"  FontSize="{StaticResource TangoSmallFontSize}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityInverseConverter}}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}">Add Color</TextBlock>
                                                    </StackPanel>
                                                </Grid>
                                            </Border>
                                        </Border>

                                        <Grid  Grid.Row="2" Margin="0 10 0 0" x:Name="colorSpacesSegment" >
                                            <ContentControl  x:Name="basicColorSpaceValues"  Focusable="False" VerticalAlignment="Top" Margin="0 0 0 0"  HorizontalAlignment="Left"  Content="{Binding FirstBrushStop}" Visibility="{Binding HasColors, Converter={StaticResource BooleanToVisibilityConverter}}">
                                                <ContentControl.Style>
                                                    <Style TargetType="ContentControl">
                                                        <Setter Property="ContentTemplate">
                                                            <Setter.Value>
                                                                <DataTemplate/>
                                                            </Setter.Value>
                                                        </Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="HSB">
                                                                <Setter Property="ContentTemplate" Value="{StaticResource HSB_Template}" />
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="RGB">
                                                                <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="Volume">
                                                                <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="LAB">
                                                                <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding FirstBrushStop.ColorSpace, Converter={StaticResource EnumToDescriptionConverter}}" Value="Catalog">
                                                                <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" />
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </ContentControl.Style>
                                            </ContentControl>
                                        </Grid>
                                    </Grid>
                                </Grid>

                            </Grid>
                        </touch:TouchDropShadowBorder>
                    </Grid>
                    <Border VerticalAlignment="Top" x:Name="borderEditDock" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 0" BorderBrush="{StaticResource TangoDividerBrush}" Padding="0 0 0 10" Margin="10 0 10 0"/>
                </Grid>

                <Grid Grid.Row="1">
                    <Grid >
                        <DockPanel VerticalAlignment="Top"  x:Name="collapsedToolbar" Margin="30 2 30 8" Height="80" HorizontalAlignment="Stretch" Visibility="{Binding IsFullMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">

                            <Border DockPanel.Dock="Right"   Height="80" CornerRadius="22" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="1" Background="{StaticResource TangoPrimaryBackgroundBrush}" >
                                <Border.Effect>
                                    <DropShadowEffect  Opacity="0.5" ShadowDepth="6" Color="Silver" BlurRadius="10" Direction="270"/>
                                </Border.Effect>
                                <UniformGrid Columns="7" Rows="1" HorizontalAlignment="Stretch" Margin="0 0 70 0">
                                    <touch:TouchButton  Style="{StaticResource TouchButtonWithDisableState}" MinHeight="50" Padding="4" Margin="20 0 0 0"  EnableDropShadow="False"  VerticalAlignment="Center" HorizontalAlignment="Center"  Command="{Binding UndoCommand}"  >
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                                            <Image Width="20" MaxWidth="50"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/undo.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Undo</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton Margin="0 0 0 0" Style="{StaticResource TouchButtonWithDisableState}" MinHeight="50" Padding="4"  EnableDropShadow="False"  VerticalAlignment="Center" HorizontalAlignment="Center"  Command="{Binding RedoCommand}"  >
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                                            <Image Width="20"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/redo.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Redo</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton  Style="{StaticResource CollapsedPanelButton}"   EnableDropShadow="False" Command="{Binding RepeateSegmentCommand}" IsEnabled="{Binding JobModel.HasSelectedItems}">
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                                            <Image  Width="20"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/repeat.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" >Repeat</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton  Style="{StaticResource CollapsedPanelButton}"   EnableDropShadow="False"  Command="{Binding ReverseCommand}" IsEnabled="{Binding JobModel.IsReverseEnable}">
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                            <Image  Width="20"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/reverse.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Reverse</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton   Style="{StaticResource CollapsedPanelButton}"   EnableDropShadow="False"  Command="{Binding DeleteSegmentCommand}" IsEnabled="{Binding JobModel.HasSelectedItems}">
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                            <Image  Width="20"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/delete_segment.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Delete</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton  Style="{StaticResource CollapsedPanelButton}"   EnableDropShadow="False"  Command="{Binding PasteCommand}" IsEnabled="{Binding JobModel.HasSegmentsToCopy}" >
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                            <Image  Width="20"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/paste.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0" VerticalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Paste</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                    <touch:TouchButton   Style="{StaticResource CollapsedPanelButton}"   EnableDropShadow="False"  Command="{Binding CopyCommand}" IsEnabled="{Binding JobModel.HasSelectedItems}">
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                            <Image  Width="19" Height="23" Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/copy.png"/>
                                            <TextBlock FontWeight="Medium" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSizeBar}" Foreground="{StaticResource TangoMidAccentBrush}">Copy</TextBlock>
                                        </StackPanel>
                                    </touch:TouchButton>
                                </UniformGrid>
                            </Border>
                            <!--<Grid DockPanel.Dock="Left" HorizontalAlignment="Left"  Margin="40 0 30 0">
                                <StackPanel DockPanel.Dock="Left" HorizontalAlignment="Left" Orientation="Horizontal"  VerticalAlignment="Center">
                                    <touch:TouchButton  Margin="0" Style="{StaticResource TouchButtonWithDisableState}" VerticalAlignment="Center" HorizontalAlignment="Left"  EnableDropShadow="False"  Command="{Binding UndoCommand}" ToolTip="Undone" >
                                        <Border Padding="0"   BorderThickness="0"  Background="Transparent" HorizontalAlignment="Left">
                                            <Image Height="28"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/undo.png"/>
                                        </Border>
                                    </touch:TouchButton>
                                    <touch:TouchButton  Margin="16 0 0 0" Style="{StaticResource TouchButtonWithDisableState}" VerticalAlignment="Center" HorizontalAlignment="Left"  EnableDropShadow="False"  Command="{Binding RedoCommand}" ToolTip="Restore">
                                        <Border Padding="0"   BorderThickness="0"  Background="Transparent" HorizontalAlignment="Left">
                                            <Image  Height="28"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/redo.png"/>
                                        </Border>
                                    </touch:TouchButton>
                                </StackPanel>
                            </Grid>-->
                        </DockPanel>
                        <Canvas  Width="70" Height="70"  Margin="0 3 40 0" HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="{Binding IsBasicMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                            <touch:TouchButton    HorizontalAlignment="Right" VerticalAlignment="Center" EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding JobModeSwitchCommand}" >
                                <Border    BorderThickness="0" Background="Transparent" HorizontalAlignment="Right">
                                    <Image Height="70" Width="70"  Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/job_mode.png"/>
                                </Border>
                            </touch:TouchButton>
                        </Canvas>
                    </Grid>
                </Grid>

                <!--<touch:TouchDropShadowBorder Grid.Row="3"  Margin="10 0 10 15" CornerRadius="0" BorderThickness="0"  Padding="0" >-->
                <Border Grid.Row="2" Margin="0 0 0 0" BorderThickness="0">
                    <touch:TouchExpander x:Name="summaryExpander" IsExpanded="{Binding IsSummaryOpened, Mode=TwoWay}"  Grid.Row="3" Margin="15 0 15 0 "  FontSize="{StaticResource TangoTitleFontSize}"  BorderThickness="0" Style="{StaticResource TouchRoundedExpander}" CornerRadius="20 20 0 0" Padding="10" IsTabStop="False" >
                        <touch:TouchExpander.Header>
                            <DockPanel Height="80">
                                <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center" >
                                    <StackPanel Orientation="Horizontal" Visibility="{Binding IsSummaryOpened, Converter={StaticResource BooleanToVisibilityInverseConverter}, Mode=TwoWay}">
                                        <TextBlock VerticalAlignment="Center"  FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                            <Run Text="Copy:" FontWeight="Normal"></Run>
                                            <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat='#,0.##'}" FontWeight="DemiBold"/>
                                            <Run Text="m" FontWeight="DemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                            <Run Text="Copy:" FontWeight="Normal"></Run>
                                            <Run  FontWeight="DemiBold">
                                                <Run.Text>
                                                    <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" >
                                                        <Binding Path="JobModel.Length" Mode="OneWay"/>
                                                         <Binding Path="JobModel.GramPerLength" Mode="OneWay"/>
                                                    </MultiBinding>
                                                </Run.Text>
                                                </Run>
                                            <Run Text="g" FontWeight="DemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock VerticalAlignment="Center" Margin="10 0 0 0"  FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                            <Run Text="Total:" FontWeight="Normal"></Run>
                                             <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/>
                                             <Run Text="m" FontWeight="Bold"></Run> 
                                        </TextBlock>
                                        <TextBlock VerticalAlignment="Center" Margin="10 0 0 0"  FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                            <Run Text="Total:" FontWeight="Normal"></Run>
                                            <Run  FontWeight="Bold" Text="{Binding JobModel.WeightIncludingNumberOfUnitsAndSpools, StringFormat='#,0.##', Mode=OneWay}">
                                                    <!--<Run.Text >
                                                        <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" >
                                                            <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" />
                                                             <Binding Path="JobModel.GramPerLength" />
                                                        </MultiBinding>
                                                    </Run.Text>-->
                                                    </Run>
                                             <Run Text="g" FontWeight="Bold"></Run> 
                                        </TextBlock>
                                    </StackPanel>
                                    <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" FontWeight="Bold" Foreground="{StaticResource TangoDarkForegroundBrush}">
                                        <Run Text="Duration: " FontWeight="Normal"></Run>
                                        <Run Text="{Binding JobModel.GetEstimatedDuration, Converter={StaticResource TimeSpanToTwoDigitsTimeConverter}, FallbackValue=0, Mode=OneWay}"></Run>
                                        <Run Text="{Binding JobModel.GetEstimatedDuration, Converter={StaticResource TimeSpanToLabelConverter}, FallbackValue=min, Mode=OneWay}"></Run>
                                    </TextBlock>
                                </StackPanel>
                                <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}">
                                    <Image Source="../Images/JobView/job-summary.png" Width="39" />
                                    <TextBlock FontWeight="Medium" Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Summary</TextBlock>
                                </StackPanel>
                            </DockPanel>
                          
                        </touch:TouchExpander.Header>
                        <Grid Margin="40 0 40 10">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid Margin=" 0 10 0 0">
                              
                                <localControls:JobModelSummaryViewerControl JobModel="{Binding JobModel}" Height="20" DisplayMarkers="False" DisplayUnits="False"/>
                                
                            </Grid>
                            <UniformGrid Grid.Row="1" Margin="0 40 0 0" Columns="4" Rows="1" HorizontalAlignment="Stretch" >
                                <TextBlock Text="Total:" FontWeight="Bold" FontSize="{StaticResource TangoTitleFontSize}" ></TextBlock>
                                <TextBlock  FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                        <Run Text="Copy:" FontWeight="Normal"></Run>
                                        <Run Text="{Binding JobModel.Length,Mode=OneWay,StringFormat='#,0.##'}" FontWeight="Bold"/>
                                        <Run Text="m" FontWeight="Bold"></Run>
                                </TextBlock>
                                <TextBlock  FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                        <Run Text="Copy:" FontWeight="Normal"></Run>
                                        <Run  FontWeight="Bold">
                                            <Run.Text>
                                                <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" >
                                                    <Binding Path="JobModel.Length" Mode="OneWay"/>
                                                     <Binding Path="JobModel.GramPerLength" Mode="OneWay"/>
                                                </MultiBinding>
                                            </Run.Text>
                                            </Run>
                                        <Run Text="g" FontWeight="DemiBold"></Run>
                                </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}">
                                        <Run Text="Copies:" FontWeight="Normal"></Run>
                                        <Run Text="{Binding JobModel.Copies}" FontWeight="Bold"/>
                                </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                        <Run Text="Total:" FontWeight="Normal"></Run>
                                        <Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/>
                                        <Run Text="m" FontWeight="Bold"></Run>
                                    </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                        <Run Text="Total:" FontWeight="Normal"></Run>
                                        <Run  FontWeight="Bold" Text="{Binding  JobModel.WeightIncludingNumberOfUnitsAndSpools, StringFormat='#,0.##', Mode=OneWay}">
                                            <!--<Run.Text>
                                                <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="#,0.##" >
                                                    <Binding Path="JobModel.LengthIncludingNumberOfUnitsAndSpools" />
                                                     <Binding Path="JobModel.GramPerLength" />
                                                </MultiBinding>
                                            </Run.Text>-->
                                            </Run>
                                        <Run Text="g" FontWeight="Bold"></Run>
                                </TextBlock>
                            </UniformGrid>
                            <UniformGrid Grid.Row="2" Margin="0 40 0 0" Columns="4" Rows="1" HorizontalAlignment="Stretch">
                                <TextBlock Text="Per Spool:" FontWeight="Bold" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
                                <TextBlock  FontSize="{StaticResource TangoTitleFontSize}"> 
                                    <Run Text="Spools:" FontWeight="Normal"></Run>
                                    <Run Text="{Binding JobModel.NumberSpools}" FontWeight="Bold"/>
                                </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}">
                                     <Run Text="Copies:" FontWeight="Normal"></Run>
                                    <Run Text="{Binding JobModel.NumberOfUnits}" FontWeight="Bold"/>
                                </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                    <Run Text="Total:" FontWeight="Normal"></Run>
                                     <Run Text="{Binding JobModel.LengthIncludingNumberOfUnits,Mode=OneWay, StringFormat='#,0.##'}" FontWeight="Bold"/>
                                     <Run Text="m" FontWeight="Bold"></Run>
                                </TextBlock>
                                <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
                                    <Run Text="Total:" FontWeight="Normal"></Run>
                                    <Run  FontWeight="Bold" Text="{Binding JobModel.WeightIncludingNumberOfUnits, Mode=OneWay, StringFormat='#,0.##'}"/>
                                     <Run Text="g" FontWeight="Bold"></Run>
                                </TextBlock>
                            </UniformGrid>
                        </Grid>
                    </touch:TouchExpander>
                </Border>
                <!--</touch:TouchDropShadowBorder>-->

                <!--<dragAndDrop:DraggingSurface x:Name="DraggingSurface" />-->
            </Grid>
        </touch:TouchLoadingPanel>

        <Border Height="77" Padding="20 0" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
            <Border.Effect>
                <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" />
            </Border.Effect>

            <Grid>
                
                <DockPanel>
                    
                    <!--<touch:TouchIconButton Icon="ArrowLeftSolid" IsHitTestVisible="{Binding NavigationManager.IsNavigating,Converter={StaticResource BooleanInverseConverter}}" IsEnabled="{Binding NavigationManager.CanNavigateBack}" Width="40" Height="40" Padding="10" Margin="10 0 10 0" Command="{Binding NavigateBackToJobs}" EnableDropShadow="False">
                        <touch:TouchIconButton.Style>
                            <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource {x:Type touch:TouchIconButton}}">
                                <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                            </Style>
                        </touch:TouchIconButton.Style>
                    </touch:TouchIconButton>-->
                    <touch:TouchTextBox IsEnabled="{Binding CanEdit}" Margin="20 6 360 0"   Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox>
                    <!--<touch:TouchButton  Margin="0 0 0 0"  VerticalAlignment="Center" Width="50" Height="50" HorizontalAlignment="Left"  EnableDropShadow="False"  Background="Transparent" BorderThickness="0" Command="{Binding EditJobDetailsCommand}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" 
                                    components:TransformationHelper.TransformWhenPressed ="False">
                        <Border  Height="24" Width="24" Margin="0 0 0 0"  BorderThickness="0" Background="Transparent" HorizontalAlignment="Center">
                            <Image   Stretch="Fill"  RenderOptions.BitmapScalingMode="Fant" Source="../Images/JobView/job_details.png"/>
                        </Border>
                    </touch:TouchButton>-->

                </DockPanel>
                <Canvas ClipToBounds="False" HorizontalAlignment="Right" Width="370">
                    <DockPanel HorizontalAlignment="Stretch" Margin="0 10 10 0" LastChildFill="False"  Canvas.Right="0">
                        <touch:TouchButton DockPanel.Dock="Right" VerticalAlignment="Center" Height="55" HorizontalAlignment="Right" Width="200" CornerRadius="30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}">
                        <touch:TouchButton.Style>
                            <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
                                <Setter Property="Content" Value="DYE"></Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding HasResumeModel}" Value="True">
                                        <Setter Property="Content" Value="RESUME"></Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </touch:TouchButton.Style>
                    </touch:TouchButton>
                    <!--<touch:TouchIconButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Icon="DeleteSweep" VerticalAlignment="Center" BorderThickness="0 0 1 0" BorderBrush="White" Height="55" Canvas.Left="-75" Canvas.Top="10" Background="{StaticResource TangoMidAccentBrush}" Padding="15" Width="100" CornerRadius="30 0 0 30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DropResumeCommand}">
                        
                    </touch:TouchIconButton>-->
                    <touch:TouchButton  Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}"  Margin="0 0 0 0" VerticalAlignment="Center" Height="55" Width="164" CornerRadius="30" Command="{Binding DropResumeCommand}"  BorderThickness="0"  EnableDropShadow="False" Style="{StaticResource TangoLinkButton}"  Foreground="{StaticResource TangoPrimaryAccentBrush}" >
                        <StackPanel Orientation="Vertical">
                            <TextBlock Margin="5 0 0 0"  FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom" Text="Edit Job" HorizontalAlignment="Center" Width="80">
                                <TextBlock.Style>
                                    <Style TargetType="{x:Type TextBlock}">
                                        <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
                                                <Setter Property="Foreground" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </TextBlock.Style>
                            </TextBlock>
                            <Rectangle Height="3"  VerticalAlignment="Bottom"  Margin="0 2 0 0" Width="84">
                                <Rectangle.Style>
                                    <Style TargetType="{x:Type Rectangle}">
                                        <Setter Property="Fill" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
                                                <Setter Property="Fill" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Rectangle.Style>
                            </Rectangle>
                        </StackPanel>
                    </touch:TouchButton>
                    </DockPanel>
                </Canvas>
            </Grid>
        </Border>
    </Grid>
</UserControl>