aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
blob: eaa17f55db702e9843dede8e5d8b880595b9f78b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.UI.Views
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : UserControl
    {
        public static MainView Instance { get; private set; }

        public MainView()
        {
            InitializeComponent();
            Instance = this;
        }
    }
}
='n304' href='#n304'>304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043
<UserControl x:Class="Tango.PPC.Jobs.Views.JobView"
             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: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:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
             xmlns:localControls="clr-namespace:Tango.PPC.Jobs.Controls"
             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}">

    <UserControl.Resources>
        <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>

        <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="3">
                <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Red}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" />
                <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Green}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" />
                <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Blue}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" />
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="CMYK_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="4">
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100"  StringFormat="0"  />
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" />
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" />
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" />
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="LAB_Template" DataType="{x:Type entities:BrushStop}">
            <UniformGrid Rows="1" Columns="3">
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding L}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="100" StringFormat="0.00" />
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding A}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" />
                <touch:TouchNumericTextBox Margin="2 0" HorizontalContentAlignment="Center" Value="{Binding B}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" />
            </UniformGrid>
        </DataTemplate>

        <DataTemplate x:Key="TWINE_Template" DataType="{x:Type entities:BrushStop}">
            <touch:TouchTextBox TapCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogFieldTapCommand}" TapCommandParameter="{Binding}" IsReadOnly="True" keyboard:KeyboardView.Mode="{x:Null}" Margin="2 0" Text="{Binding ColorCatalog.Name}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" />
        </DataTemplate>

        <DataTemplate x:Key="BrushStop_Template" DataType="{x:Type entities:BrushStop}">
            <Grid Margin="50 20 140 20" RenderOptions.EdgeMode="Aliased">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Border Width="48" Height="48" CornerRadius="5" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">
                            <Border.Background>
                                <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
                            </Border.Background>
                        </Border>

                        <TextBlock Margin="30 0 0 0" FontSize="{StaticResource TangoTitleFontSize}">
                                                                                        <Run>#</Run><Run Text="{Binding Segment.SegmentIndex}"></Run><Run>.</Run><Run Text="{Binding StopIndex}"></Run>
                        </TextBlock>
                    </StackPanel>

                    <DockPanel LastChildFill="False" Margin="0 20 0 0">
                        <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Color code:</TextBlock>
                        <ContentControl Focusable="False" Margin="20 0 0 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="300" Content="{Binding}">
                            <ContentControl.Style>
                                <Style TargetType="ContentControl">
                                    <Setter Property="ContentTemplate" Value="{x:Null}"></Setter>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB">
                                            <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK">
                                            <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB">
                                            <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="Twine">
                                            <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ContentControl.Style>
                        </ContentControl>
                    </DockPanel>

                    <Canvas Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}">
                        <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock>
                    </Canvas>

                    <DockPanel LastChildFill="False" Margin="0 20 0 0" IsEnabled="{Binding IsMiddle}">
                        <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Position (m):</TextBlock>
                        <Grid Margin="20 0 0 0" Width="300" DockPanel.Dock="Right">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*" />
                                <ColumnDefinition Width="2*" />
                            </Grid.ColumnDefinitions>

                            <touch:TouchNumericTextBox Value="{Binding OffsetMeters}" HasDecimalPoint="True" StringFormat="0.0" Maximum="{Binding Segment.Length}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox>
                            <!--<touch:TouchSlider Grid.Column="1" Height="30" Margin="10 0 0 -23" Maximum="{Binding Segment.Length}" Value="{Binding OffsetMeters}" />-->
                        </Grid>
                    </DockPanel>
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin="0 0 -130 0" HorizontalAlignment="Right" VerticalAlignment="Top">
                    <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding}" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30"></touch:TouchImageButton>
                    <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveBrushStopCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" />
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="Segment_Template" DataType="{x:Type entities:Segment}">
            <Border Margin="0 0 0 15" RenderOptions.EdgeMode="Aliased" CornerRadius="8" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}">
                <Border.Effect>
                    <DropShadowEffect Opacity="0.5" Color="{StaticResource TangoDropShadowColor}" BlurRadius="10" ShadowDepth="15" />
                </Border.Effect>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SegmentDroppedCommand}"  dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.Droppable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding ElementName=DraggingSurface}">
                        <Grid.Style>
                            <Style TargetType="Grid">
                                <Setter Property="Opacity" Value="1"></Setter>
                                <Style.Triggers>
                                    <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True">
                                        <Setter Property="Opacity" Value="0.5"></Setter>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </Grid.Style>
                        <DockPanel>
                            <DockPanel.Style>
                                <Style TargetType="DockPanel">
                                    <Setter Property="Height" Value="163"></Setter>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True">
                                            <Setter Property="Height" Value="74"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </DockPanel.Style>
                            <Border DockPanel.Dock="Left" Background="{Binding SegmentBrush}">
                                <Border.Style>
                                    <Style TargetType="Border">
                                        <Setter Property="CornerRadius" Value="8 0 0 8"></Setter>
                                        <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True">
                                                <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2'}"></Setter>
                                            </DataTrigger>
                                            <MultiDataTrigger>
                                                <MultiDataTrigger.Conditions>
                                                    <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition>
                                                    <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition>
                                                </MultiDataTrigger.Conditions>
                                                <Setter Property="CornerRadius" Value="8 0 0 0"></Setter>
                                            </MultiDataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Border.Style>
                            </Border>

                            <Grid>
                                <DockPanel Margin="30 0" VerticalAlignment="Center">
                                    <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                                        <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter}}">
                                            <Image Canvas.Left="-25" Canvas.Top="1" Source="../Images/JobView/error.png"  Width="19" Height="19" />
                                        </Canvas>
                                        <TextBlock FontSize="{StaticResource TangoTitleFontSize}">
                                                                    <Run>Segment #</Run>
                                                                    <Run Text="{Binding SegmentIndex,Mode=OneWay}"></Run>
                                        </TextBlock>
                                    </StackPanel>

                                    <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}">
                                        <DockPanel LastChildFill="False">
                                            <DockPanel.Style>
                                                <Style TargetType="DockPanel">
                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True">
                                                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </DockPanel.Style>
                                            <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Text="Color code:"></TextBlock>

                                            <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0]}">
                                                <StackPanel>
                                                    <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180">
                                                        <ContentControl.Style>
                                                            <Style TargetType="ContentControl">
                                                                <Setter Property="ContentTemplate" Value="{x:Null}"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB">
                                                                        <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK">
                                                                        <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB">
                                                                        <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="Twine">
                                                                        <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" />
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </ContentControl.Style>
                                                    </ContentControl>
                                                </StackPanel>
                                            </Grid>
                                        </DockPanel>
                                        <Canvas>
                                            <Canvas.Style>
                                                <Style TargetType="Canvas">
                                                    <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                    <Style.Triggers>
                                                        <MultiDataTrigger>
                                                            <MultiDataTrigger.Conditions>
                                                                <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" />
                                                                <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" />
                                                            </MultiDataTrigger.Conditions>
                                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                                        </MultiDataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Canvas.Style>
                                            <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock>
                                        </Canvas>
                                        <DockPanel LastChildFill="False" Margin="0 20 0 0">
                                            <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Text="Length (m):"></TextBlock>
                                            <touch:TouchNumericTextBox Width="180" DockPanel.Dock="Right" Value="{Binding Length}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" />
                                        </DockPanel>
                                    </StackPanel>
                                </DockPanel>

                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 10 10 0">
                                    <TextBlock Visibility="{Binding ElementName=toggle_small_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Length,StringFormat={}{0:N1} m}">
                                        <TextBlock.Style>
                                            <Style TargetType="TextBlock">
                                                <Setter Property="Margin" Value="0 16 20 0"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=toggleEdit,Path=IsChecked}" Value="True">
                                                        <Setter Property="Margin" Value="0 5 20 0"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>

                                    <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30">
                                        <touch:TouchImageButton.Style>
                                            <Style TargetType="{x:Type touch:TouchImageButton}" BasedOn="{StaticResource {x:Type touch:TouchImageButton}}">
                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                <Style.Triggers>
                                                    <MultiDataTrigger>
                                                        <MultiDataTrigger.Conditions>
                                                            <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True" />
                                                            <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" />
                                                            <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" />
                                                        </MultiDataTrigger.Conditions>
                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                    </MultiDataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </touch:TouchImageButton.Style>
                                    </touch:TouchImageButton>

                                    <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Orientation="Horizontal">

                                        <touch:TouchIconButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" />

                                        <dragAndDrop:DragThumb Background="Transparent" IsHitTestVisible="True">
                                            <touch:TouchIconButton IsHitTestVisible="False" EnableDropShadow="False" Icon="BarsSolid" Padding="15" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" />
                                        </dragAndDrop:DragThumb>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </DockPanel>
                    </Grid>

                    <Border Grid.Row="1" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0 1 0 0">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition>
                                            <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition>
                                        </MultiDataTrigger.Conditions>

                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>

                        <StackPanel>
                            <ItemsControl ItemsSource="{Binding BrushStops}" ItemTemplate="{StaticResource BrushStop_Template}">

                            </ItemsControl>

                            <touch:TouchButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.AddBrushStopCommand}" CommandParameter="{Binding}" Background="Transparent" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontWeight="Normal" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalAlignment="Left" EnableDropShadow="False" Margin="50 30 0 60">
                                <StackPanel Orientation="Horizontal">
                                    <Grid Width="49" Height="49">
                                        <Rectangle Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="5" RadiusY="5"></Rectangle>
                                        <fa:ImageAwesome Icon="Plus" Width="16" Height="16" Foreground="{StaticResource TangoPrimaryAccentBrush}" />
                                    </Grid>

                                    <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</TextBlock>
                                </StackPanel>
                            </touch:TouchButton>
                        </StackPanel>
                    </Border>
                </Grid>
            </Border>
        </DataTemplate>
    </UserControl.Resources>

    <Grid Background="{StaticResource TangoMidBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2">
                <touch:LightTouchScrollViewer x:Name="scrollViewer">
                    <StackPanel Margin="10 60 10 0">
                        <StackPanel>
                            <touch:TouchExpander Padding="20 15">
                                <touch:TouchExpander.Header>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0">
                                        <Image Source="../Images/JobView/job-details.png" Width="39" />
                                        <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Details</TextBlock>

                                        <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center" Text="{Binding Job.Rml.Name}"></TextBlock>
                                    </StackPanel>
                                </touch:TouchExpander.Header>

                                <StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium">
                                    <controls:TableGrid RowHeight="50">

                                        <TextBlock>Job name:</TextBlock>
                                        <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />

                                        <TextBlock>Customer:</TextBlock>
                                        <touch:TouchAutoComplete Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />

                                        <TextBlock>Thread type:</TextBlock>
                                        <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread Type" />

                                        <TextBlock>Comment:</TextBlock>
                                        <TextBox Margin="20 0 0 -42" Text="{Binding Job.Description}" FocusVisualStyle="{x:Null}" BorderBrush="{StaticResource TangoDividerBrush}" Foreground="{StaticResource TangoDarkForegroundBrush}" AcceptsReturn="True" TextWrapping="Wrap" Height="60" Padding="5">

                                        </TextBox>
                                    </controls:TableGrid>

                                    <Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock HorizontalAlignment="Left">
                                    <Run Text="Job status:"></Run>
                                    <Run Text="{Binding Job.JobStatus}"></Run>
                                        </TextBlock>

                                        <Rectangle Margin="20 0" Grid.Column="1" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" />

                                        <TextBlock Grid.Column="2" HorizontalAlignment="Center">
                                    <Run Text="Last updated:"></Run>
                                    <Run Text="{Binding Job.LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run>
                                        </TextBlock>

                                        <Rectangle Margin="20 0" Grid.Column="3" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" />

                                        <TextBlock Grid.Column="4" HorizontalAlignment="Right">
                                    <Run Text="Last dye:"></Run>
                                    <Run Text="{Binding Job.LastRun,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run>
                                        </TextBlock>
                                    </Grid>
                                </StackPanel>
                            </touch:TouchExpander>

                            <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40">
                                <Grid>
                                    <StackPanel>
                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}">
                                            <Image Source="../Images/JobView/color-length.png" Width="39" />
                                            <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color &amp; Length</TextBlock>
                                        </StackPanel>

                                        <StackPanel>
                                            <StackPanel.Style>
                                                <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}">
                                                    <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}">
                                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </StackPanel.Style>
                                            <UniformGrid Columns="2" Rows="1">
                                                <DockPanel Margin="0 0 10 0">
                                                    <TextBlock Text="Number of units:" VerticalAlignment="Center"></TextBlock>
                                                    <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" />
                                                </DockPanel>

                                                <DockPanel Margin="10 0 0 0">
                                                    <TextBlock Text="Number of heads:" VerticalAlignment="Center"></TextBlock>
                                                    <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfHeads}" Minimum="1" Maximum="1000" JoggingFactor="0.1" />
                                                </DockPanel>
                                            </UniformGrid>
                                        </StackPanel>

                                        <DockPanel Style="{StaticResource Level2Container}">
                                            <TextBlock Text="Color Catalog/Space:" VerticalAlignment="Center"></TextBlock>
                                            <touch:TouchComboBox Margin="20 0 0 0" ItemsSource="{Binding ColorSpaces}" SelectedItem="{Binding Job.ColorSpace}" DisplayMemberPath="Name" Title="Select Color Catalog/Space" />
                                        </DockPanel>

                                        <DockPanel LastChildFill="False" Style="{StaticResource Level2ContainerExtraMargin}" Height="40">
                                            <StackPanel DockPanel.Dock="Left" Orientation="Horizontal">
                                                <touch:TouchToggleIconButton x:Name="toggle_small_list" IsChecked="{Binding ElementName=toggle_large_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ListSolid" CheckedIcon="ListSolid" Padding="8" CornerRadius="20" />
                                                <Rectangle HorizontalAlignment="Left" Stroke="{StaticResource TangoDividerBrush}" Margin="10 8" />
                                                <touch:TouchToggleIconButton x:Name="toggle_large_list" IsChecked="{Binding ElementName=toggle_small_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ThListSolid" CheckedIcon="ThListSolid" Padding="8" CornerRadius="20" />
                                            </StackPanel>

                                            <touch:TouchToggleIconButton x:Name="toggleEdit" DockPanel.Dock="Right" Icon="Pencil" CheckedIcon="Pencil" Padding="8" CornerRadius="20" />
                                        </DockPanel>

                                        <ItemsControl Style="{StaticResource Level2Container}" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplate="{StaticResource Segment_Template}"></ItemsControl>

                                        <StackPanel HorizontalAlignment="Right" Style="{StaticResource Level2Container}" Orientation="Horizontal">
                                            <touch:TouchButton Command="{Binding AddSolidSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="170" CornerRadius="20" Padding="0 10" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}">
                                                <StackPanel Orientation="Horizontal">
                                                    <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" />
                                                    <TextBlock Margin="10 0 0 0">SOLID SEGMENT</TextBlock>
                                                </StackPanel>
                                            </touch:TouchButton>
                                            <touch:TouchButton Command="{Binding AddGradientSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" Margin="30 0 0 0" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Padding="0 10" Width="200" CornerRadius="20" Background="Transparent" BorderThickness="2">
                                                <touch:TouchButton.BorderBrush>
                                                    <LinearGradientBrush>
                                                        <GradientStop Offset="0" Color="{StaticResource TangoPrimaryAccentColor}" />
                                                        <GradientStop Offset="1" Color="#57F157" />
                                                    </LinearGradientBrush>
                                                </touch:TouchButton.BorderBrush>

                                                <StackPanel Orientation="Horizontal">
                                                    <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" />
                                                    <TextBlock Margin="10 0 0 0">GRADIENT SEGMENT</TextBlock>
                                                </StackPanel>
                                            </touch:TouchButton>
                                        </StackPanel>

                                        <StackPanel Style="{StaticResource Level2ContainerExtraMargin}">
                                            <DockPanel LastChildFill="False">
                                                <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox>
                                                <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0">
                                                    <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}">
                                                    <Run Text="Length (m):"></Run>
                                                    </TextBlock>

                                                    <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" />

                                                    <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" />
                                                </StackPanel>
                                            </DockPanel>
                                        </StackPanel>

                                        <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" />

                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}">
                                            <Image Source="../Images/JobView/output.png" Width="39" />
                                            <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Output</TextBlock>
                                        </StackPanel>

                                        <DockPanel Style="{StaticResource Level2Container}">
                                            <TextBlock Text="Output spool (m):" VerticalAlignment="Center"></TextBlock>
                                            <touch:TouchComboBox ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding Job.SpoolType}" Margin="40 0 0 0" DisplayMemberPath="Name" Title="Select Output Spool" />
                                        </DockPanel>

                                        <DockPanel Style="{StaticResource Level2Container}">
                                            <TextBlock Text="Segments per spool:" VerticalAlignment="Center"></TextBlock>
                                            <touch:TouchToggleSlider Margin="30 0 0 0" BorderThickness="2" Height="38" Width="83" HorizontalAlignment="Left" UncheckedContent="One" CheckedContent="All" IsChecked="{Binding Job.IsAllSegmentsPerSpool}" />
                                        </DockPanel>
                                    </StackPanel>
                                </Grid>
                            </Border>

                            <Border Style="{StaticResource TangoTouchBorder}" Margin="0 20 0 0" Padding="0 0 0 50">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}">
                                        <Image Source="../Images/JobView/job-summary.png" Width="39" />
                                        <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock>
                                    </StackPanel>

                                    <StackPanel Style="{StaticResource Level2ContainerExtraMargin}">
                                        <Grid>
                                            <localControls:JobSummeryViewer DataContext="{Binding Job}" />
                                        </Grid>

                                        <DockPanel Margin="0 30 0 0" LastChildFill="False">

                                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center">
                                                <TextBlock>
                                                    <Run Text="Job length (m):"></Run>
                                                    <Run Text="{Binding Job.Length,Mode=OneWay}"></Run>
                                                </TextBlock>
                                                <TextBlock Foreground="{StaticResource TangoGrayTextBrush}">
                                                    <TextBlock.Style>
                                                        <Style TargetType="TextBlock">
                                                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True">
                                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </TextBlock.Style>
                                                    <Run>(</Run><Run Text="{Binding Job.Length,Mode=OneWay}"></Run><Run>+</Run><Run Text="{Binding Job.LengthPercentageFactor,Mode=OneWay}"></Run><Run>%</Run><Run>)</Run>
                                                </TextBlock>
                                            </StackPanel>

                                            <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0">
                                                <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}">
                                                    <Run Text="Factor: +"></Run>
                                                </TextBlock>

                                                <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="30" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" />

                                                <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock>

                                                <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" />
                                            </StackPanel>
                                        </DockPanel>
                                    </StackPanel>
                                </StackPanel>
                            </Border>

                            <StackPanel HorizontalAlignment="Center" Margin="20 40 0 40" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}">
                                <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Additional Tools</TextBlock>
                            </StackPanel>

                            <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center"  Style="{StaticResource Level1Container}">
                                        <Image Source="../Images/JobView/additional-tools.png" Width="39" />
                                        <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Additional Tools</TextBlock>
                                    </StackPanel>

                                    <StackPanel Style="{StaticResource Level2Container}" HorizontalAlignment="Left">

                                        <DockPanel LastChildFill="False">
                                            <TextBlock Text="Make a sample dye" VerticalAlignment="Center"></TextBlock>
                                            <touch:TouchToggleSlider x:Name="toggle_sample_dye" DockPanel.Dock="Right" Width="75" Style="{StaticResource TouchToggleButtonCheck}" Margin="30 0 0 0" Height="38" HorizontalAlignment="Left" />
                                        </DockPanel>

                                        <DockPanel Margin="0 25 0 0" LastChildFill="False">
                                            <TextBlock Text="Run color fine tuning" VerticalAlignment="Center"></TextBlock>
                                            <touch:TouchToggleSlider DockPanel.Dock="Right" Width="75" Style="{StaticResource TouchToggleButtonCheck}" Margin="30 0 0 0" Height="38" HorizontalAlignment="Left" />
                                        </DockPanel>
                                    </StackPanel>
                                </StackPanel>
                            </Border>-->

                            <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15">
                                <touch:TouchExpander.Header>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0">
                                        <Image Source="../Images/JobView/sample-dye.png" Width="39" />
                                        <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock>
                                    </StackPanel>
                                </touch:TouchExpander.Header>

                                <StackPanel>
                                    <StackPanel Margin="60 20 0 0">
                                        <ContentControl>
                                            <ContentControl.Style>
                                                <Style TargetType="ContentControl">
                                                    <Setter Property="Content">
                                                        <Setter.Value>
                                                            <StackPanel>
                                                                <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}">
                                                                    <ContentControl.Style>
                                                                        <Style TargetType="ContentControl">
                                                                            <Setter Property="ContentTemplate">
                                                                                <Setter.Value>
                                                                                    <DataTemplate>
                                                                                        <StackPanel>
                                                                                            <TextBlock>
                                                                    <Run>Dye 1 or more units in order to get approval.</Run>
                                                                    <LineBreak/>
                                                                    <Run>Once approved, you can dye the entire job.</Run>
                                                                                            </TextBlock>

                                                                                            <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left">
                                                                                                <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock>

                                                                                                <DockPanel Margin="50 0 0 0">
                                                                                                    <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" />
                                                                                                    <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" />
                                                                                                    <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" />
                                                                                                </DockPanel>
                                                                                            </DockPanel>
                                                                                        </StackPanel>
                                                                                    </DataTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                            <Style.Triggers>
                                                                                <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Sewing}">
                                                                                    <Setter Property="ContentTemplate">
                                                                                        <Setter.Value>
                                                                                            <DataTemplate>
                                                                                                <StackPanel>
                                                                                                    <TextBlock>
                                                                    <Run>Dye several meters per segment in order to get approval.</Run>
                                                                    <LineBreak/>
                                                                    <Run>Once approved, you can dye the entire job.</Run>
                                                                                                    </TextBlock>

                                                                                                    <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left">
                                                                                                        <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">Meters per segment</TextBlock>

                                                                                                        <DockPanel Margin="50 0 0 0">
                                                                                                            <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" />
                                                                                                            <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" />
                                                                                                            <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" />
                                                                                                        </DockPanel>
                                                                                                    </DockPanel>
                                                                                                </StackPanel>
                                                                                            </DataTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </DataTrigger>
                                                                            </Style.Triggers>
                                                                        </Style>
                                                                    </ContentControl.Style>
                                                                </ContentControl>

                                                                <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}">
                                                                    START
                                                                </touch:TouchButton>
                                                            </StackPanel>
                                                        </Setter.Value>
                                                    </Setter>

                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}">
                                                            <Setter Property="Content">
                                                                <Setter.Value>
                                                                    <StackPanel>
                                                                        <TextBlock>How to continue?</TextBlock>

                                                                        <UniformGrid Columns="2" Width="420" HorizontalAlignment="Left" Margin="0 40 0 20">
                                                                            <StackPanel HorizontalAlignment="Left">
                                                                                <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveSampleCommand}">
                                                                                    <StackPanel Orientation="Horizontal">
                                                                                        <touch:TouchIcon Icon="Check"></touch:TouchIcon>
                                                                                        <TextBlock Margin="10 0 0 0">DONE</TextBlock>
                                                                                    </StackPanel>
                                                                                </touch:TouchButton>

                                                                                <TextBlock Margin="0 15 0 0" TextAlignment="Center">The sample is approved</TextBlock>
                                                                            </StackPanel>

                                                                            <StackPanel HorizontalAlignment="Right">
                                                                                <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatSampleDyeCommand}">
                                                                                    <StackPanel Orientation="Horizontal">
                                                                                        <touch:TouchIcon Icon="Repeat"></touch:TouchIcon>
                                                                                        <TextBlock Margin="10 0 0 0">REPEAT</TextBlock>
                                                                                    </StackPanel>
                                                                                </touch:TouchButton>

                                                                                <TextBlock Margin="0 15 0 0" TextAlignment="Center">Dye more samples</TextBlock>
                                                                            </StackPanel>
                                                                        </UniformGrid>

                                                                    </StackPanel>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>

                                                        <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}">
                                                            <Setter Property="Content">
                                                                <Setter.Value>
                                                                    <StackPanel Margin="0 40 80 40">
                                                                        <DockPanel LastChildFill="False">
                                                                            <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">
                                                                            <Run>Sample Approved:</Run>
                                                                            <Run Text="{Binding Job.SampleDyeApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run>
                                                                            </TextBlock>
                                                                            <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}">
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <touch:TouchIcon Icon="Plus"></touch:TouchIcon>
                                                                                    <TextBlock Margin="10 0 0 0">ANOTHER SAMPLE</TextBlock>
                                                                                </StackPanel>
                                                                            </touch:TouchButton>
                                                                        </DockPanel>
                                                                    </StackPanel>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </ContentControl.Style>
                                        </ContentControl>
                                    </StackPanel>

                                    <StackPanel Margin="0 0 0 15">
                                        <StackPanel.Style>
                                            <Style TargetType="StackPanel">
                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}">
                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </StackPanel.Style>
                                        <Rectangle HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" Margin="-20 30"></Rectangle>

                                        <StackPanel Orientation="Horizontal" Margin="60 0 0 0">
                                            <touch:TouchIcon Icon="AlertCircleOutline" Width="32" Height="32" StrokeThickness="0.1" Foreground="{StaticResource TangoGrayBrush}" />
                                            <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">
                                            You can use the color fine tuning tool to adjust the colors.
                                            </TextBlock>
                                        </StackPanel>
                                    </StackPanel>
                                </StackPanel>
                            </touch:TouchExpander>

                            <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}">
                                <touch:TouchExpander.Header>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0">
                                        <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" />
                                        <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock>
                                    </StackPanel>
                                </touch:TouchExpander.Header>

                                <StackPanel Margin="60 20 0 0">

                                    <ContentControl>
                                        <ContentControl.Style>
                                            <Style TargetType="ContentControl">
                                                <Setter Property="Content">
                                                    <Setter.Value>
                                                        <StackPanel>
                                                            <TextBlock>Select the colors you want to fine tune.</TextBlock>

                                                            <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0">
                                                                <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock>

                                                                <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}">
                                                                    <ItemsControl.ItemTemplate>
                                                                        <DataTemplate>
                                                                            <DockPanel>
                                                                                <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" />
                                                                                <touch:TouchImageButton DockPanel.Dock="Right" Image="../Images/JobView/color-picker.png" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton>
                                                                                <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False">
                                                                                    <touch:TouchFlatListBox.ItemsPanel>
                                                                                        <ItemsPanelTemplate>
                                                                                            <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid>
                                                                                        </ItemsPanelTemplate>
                                                                                    </touch:TouchFlatListBox.ItemsPanel>
                                                                                    <touch:TouchFlatListBox.ItemTemplate>
                                                                                        <DataTemplate>
                                                                                            <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0">
                                                                                                <Ellipse.Style>
                                                                                                    <Style TargetType="Ellipse">
                                                                                                        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
                                                                                                        <Setter Property="RenderTransform">
                                                                                                            <Setter.Value>
                                                                                                                <ScaleTransform ScaleX="1" ScaleY="1" />
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Setter Property="Effect">
                                                                                                            <Setter.Value>
                                                                                                                <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" />
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Style.Triggers>
                                                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                                                <DataTrigger.EnterActions>
                                                                                                                    <BeginStoryboard>
                                                                                                                        <Storyboard>
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" />
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" />
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />
                                                                                                                        </Storyboard>
                                                                                                                    </BeginStoryboard>
                                                                                                                </DataTrigger.EnterActions>
                                                                                                                <DataTrigger.ExitActions>
                                                                                                                    <BeginStoryboard>
                                                                                                                        <Storyboard>
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" />
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" />
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />
                                                                                                                        </Storyboard>
                                                                                                                    </BeginStoryboard>
                                                                                                                </DataTrigger.ExitActions>
                                                                                                            </DataTrigger>
                                                                                                        </Style.Triggers>
                                                                                                    </Style>
                                                                                                </Ellipse.Style>
                                                                                            </Ellipse>
                                                                                        </DataTemplate>
                                                                                    </touch:TouchFlatListBox.ItemTemplate>
                                                                                </touch:TouchFlatListBox>
                                                                            </DockPanel>
                                                                        </DataTemplate>
                                                                    </ItemsControl.ItemTemplate>
                                                                </ItemsControl>
                                                            </StackPanel>

                                                            <DockPanel LastChildFill="False" Margin="0 80 0 0">
                                                                <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton>

                                                                <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}">
                                                                    START
                                                                </touch:TouchButton>
                                                            </DockPanel>
                                                        </StackPanel>
                                                    </Setter.Value>
                                                </Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}">
                                                        <Setter Property="Content">
                                                            <Setter.Value>
                                                                <StackPanel Margin="0 20 0 0">
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Grid>
                                                                            <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse>
                                                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock>
                                                                        </Grid>
                                                                        <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock>
                                                                    </StackPanel>

                                                                    <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000">
                                                                        <ItemsControl.ItemTemplate>
                                                                            <DataTemplate>
                                                                                <DockPanel>
                                                                                    <TextBlock Margin="0 0 20 0" VerticalAlignment="Center">
                                                                                        <Run>Color</Run>
                                                                                        <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run>
                                                                                    </TextBlock>
                                                                                    <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}">
                                                                                        <touch:TouchFlatListBox.ItemsPanel>
                                                                                            <ItemsPanelTemplate>
                                                                                                <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid>
                                                                                            </ItemsPanelTemplate>
                                                                                        </touch:TouchFlatListBox.ItemsPanel>
                                                                                        <touch:TouchFlatListBox.ItemTemplate>
                                                                                            <DataTemplate>
                                                                                                <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0">
                                                                                                    <Ellipse.Style>
                                                                                                        <Style TargetType="Ellipse">
                                                                                                            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
                                                                                                            <Setter Property="RenderTransform">
                                                                                                                <Setter.Value>
                                                                                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                                                                                </Setter.Value>
                                                                                                            </Setter>
                                                                                                            <Setter Property="Effect">
                                                                                                                <Setter.Value>
                                                                                                                    <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" />
                                                                                                                </Setter.Value>
                                                                                                            </Setter>
                                                                                                            <Style.Triggers>
                                                                                                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                                                    <DataTrigger.EnterActions>
                                                                                                                        <BeginStoryboard>
                                                                                                                            <Storyboard>
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" />
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" />
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />
                                                                                                                            </Storyboard>
                                                                                                                        </BeginStoryboard>
                                                                                                                    </DataTrigger.EnterActions>
                                                                                                                    <DataTrigger.ExitActions>
                                                                                                                        <BeginStoryboard>
                                                                                                                            <Storyboard>
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" />
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" />
                                                                                                                                <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />
                                                                                                                            </Storyboard>
                                                                                                                        </BeginStoryboard>
                                                                                                                    </DataTrigger.ExitActions>
                                                                                                                </DataTrigger>
                                                                                                            </Style.Triggers>
                                                                                                        </Style>
                                                                                                    </Ellipse.Style>
                                                                                                </Ellipse>
                                                                                            </DataTemplate>
                                                                                        </touch:TouchFlatListBox.ItemTemplate>
                                                                                    </touch:TouchFlatListBox>
                                                                                </DockPanel>
                                                                            </DataTemplate>
                                                                        </ItemsControl.ItemTemplate>
                                                                    </ItemsControl>

                                                                    <StackPanel Orientation="Horizontal" Margin="0 40 0 0">
                                                                        <Grid>
                                                                            <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse>
                                                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock>
                                                                        </Grid>
                                                                        <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock>
                                                                    </StackPanel>

                                                                    <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20">
                                                                        <StackPanel HorizontalAlignment="Left">
                                                                            <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}">
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <touch:TouchIcon Icon="Check"></touch:TouchIcon>
                                                                                    <TextBlock Margin="10 0 0 0">DONE</TextBlock>
                                                                                </StackPanel>
                                                                            </touch:TouchButton>

                                                                            <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock>
                                                                        </StackPanel>

                                                                        <StackPanel HorizontalAlignment="Right">
                                                                            <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}">
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <touch:TouchIcon Icon="Repeat"></touch:TouchIcon>
                                                                                    <TextBlock Margin="10 0 0 0">REPEAT</TextBlock>
                                                                                </StackPanel>
                                                                            </touch:TouchButton>

                                                                            <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock>
                                                                        </StackPanel>
                                                                    </UniformGrid>
                                                                </StackPanel>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </DataTrigger>

                                                    <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}">
                                                        <Setter Property="Content">
                                                            <Setter.Value>
                                                                <StackPanel Margin="0 40 80 40">
                                                                    <DockPanel LastChildFill="False">
                                                                        <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">
                                                                            <Run>Colors Approved:</Run>
                                                                            <Run Text="{Binding Job.FineTuningApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run>
                                                                        </TextBlock>
                                                                        <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}">
                                                                            <StackPanel Orientation="Horizontal">
                                                                                <touch:TouchIcon Icon="Plus"></touch:TouchIcon>
                                                                                <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock>
                                                                            </StackPanel>
                                                                        </touch:TouchButton>
                                                                    </DockPanel>
                                                                </StackPanel>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </ContentControl.Style>
                                    </ContentControl>
                                </StackPanel>
                            </touch:TouchExpander>
                        </StackPanel>
                    </StackPanel>
                </touch:LightTouchScrollViewer>
            </Grid>

            <Grid Grid.Row="1">
                <Grid IsHitTestVisible="False">
                    <Grid.Background>
                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                            <GradientStop Offset="0" Color="#AEFFFFFF" />
                            <GradientStop Offset="1" Color="{StaticResource TangoPrimaryBackgroundColor}" />
                        </LinearGradientBrush>
                    </Grid.Background>
                    <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" />
                </Grid>
                <Border Padding="20 20">
                    <Grid>
                        <DockPanel>
                            <touch:TouchButton IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" DelayCommand="{Binding DyeCommand}" DelayCommandDuration="00:00:0.3">
                                DYE
                            </touch:TouchButton>

                            <!--Add this in case you want to display job summery on bottom panel-->
                            <!--<localControls:JobSummeryViewer DataContext="{Binding Job}" Height="35" Margin="0 -20 30 0" />-->
                        </DockPanel>
                    </Grid>
                </Border>
            </Grid>

            <dragAndDrop:DraggingSurface x:Name="DraggingSurface" />
        </Grid>

        <Border Padding="20" 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>
                <StackPanel Orientation="Horizontal" Width="450" HorizontalAlignment="Left">
                    <TextBlock MaxWidth="360" TextTrimming="CharacterEllipsis" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold" Text="{Binding Job.Name,FallbackValue='Job Name'}"/>
                    <TextBlock Margin="20 0 0 5" VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayTextBrush}">
                        <Run>(</Run><Run Text="{Binding Job.JobType,FallbackValue=Embroidery}"></Run><Run>)</Run>
                    </TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="57" Margin="0 0 30 -45">
                    <touch:TouchIconButton Margin="0 0 30 0" Padding="17" Style="{StaticResource TangoRoundTouchIconButton}" Icon="EllipsisVSolid" />
                    <touch:TouchIconButton Command="{Binding RemoveJobCommand}" Margin="0 0 30 0" Padding="17" Style="{StaticResource TangoRoundTouchIconButton}" Icon="TrashAltRegular" />
                    <touch:TouchIconButton Command="{Binding SaveJobCommand}" Padding="18" Style="{StaticResource TangoRoundTouchIconButton}" Icon="SaveRegular" />
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>