aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
blob: 820c5bb18b4e0528950d3610b1d9a83964a0d0e8 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59<
using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using Tango.BL;
using Tango.BL.Enumerations;
using Tango.Core.Helpers;
using Tango.MachineStudio.Common;
using Tango.MachineStudio.Statistics.Models;
using System.Data.Entity;
using Tango.MachineStudio.Common.Notifications;
using Tango.BL.Entities;

namespace Tango.MachineStudio.Statistics.ViewModels
{
    public class MainViewVM : StudioViewModel
    {
        private INotificationProvider _notification;

        private ChartsViewVM _chartsViewVM;
        public ChartsViewVM ChartsViewVM
        {
            get { return _chartsViewVM; }
            set { _chartsViewVM = value; RaisePropertyChangedAuto(); }
        }

        private JobRunsViewVM _jobRunsViewVM;
        public JobRunsViewVM JobRunsViewVM
        {
            get { return _jobRunsViewVM; }
            set { _jobRunsViewVM = value; RaisePropertyChangedAuto(); }
        }
        
        public MainViewVM(INotificationProvider notificationProvider)
        {
            _notification = notificationProvider;
            ChartsViewVM = new ChartsViewVM(_notification);
            JobRunsViewVM = new JobRunsViewVM(_notification);
        }

        public override void OnApplicationReady()
        {
            JobRunsViewVM.Init();
        }

        public override void OnNavigatedTo()
        {
            base.OnNavigatedTo();
        }
    }
}
> 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 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219
<UserControl x:Class="Tango.MachineStudio.Developer.Views.MainView"
             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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:global="clr-namespace:Tango.MachineStudio.Developer"
             xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
             xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB"
             xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common"
             xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels"
             xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration"
             xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
             xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video"
             xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI"
             xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">

    <UserControl.InputBindings>
        <KeyBinding Key="Esc" Command="{Binding ExitFullScreenCommand}"></KeyBinding>
    </UserControl.InputBindings>

    <UserControl.Resources>
        <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
            <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" />
            <Setter Property="Margin" Value="2" />
        </Style>

        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
        <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
        <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
        <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter>
        <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter>
        <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter>
        <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter>
        <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" />
        <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" />
        <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" />
        <localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" />
        <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" />
        <localConverters:JobToColumnDefinitionsConverter x:Key="JobToColumnDefinitionsConverter" />
        <localConverters:SegmentLengthToWidthConverter x:Key="SegmentLengthToWidthConverter" />
        <localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" />
        <localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" />
        <localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
        <localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
        <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" />
        <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" />
        <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
        <converters:NumberToFileSizeConverter x:Key="NumberToFileSizeConverter"/>

        <SolidColorBrush x:Key="SideBarBackground" Color="White">

        </SolidColorBrush>

        <Color x:Key="dummyColor">Transparent</Color>

        <Style x:Key="droppableGrid" TargetType="Grid">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
                </Setter.Value>
            </Setter>
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
            <Style.Triggers>
                <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True">
                    <Setter Property="Opacity" Value="0.5"></Setter>
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="brushStopBorder" TargetType="Border">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
                </Setter.Value>
            </Setter>
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
            <Style.Triggers>
                <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True">
                    <Setter Property="Opacity" Value="0.5"></Setter>
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="draggableGrid" TargetType="Grid">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
                </Setter.Value>
            </Setter>
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
        </Style>

        <Style TargetType="Border" x:Key="JobFieldBorder">
            <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
            <Setter Property="BorderThickness" Value="0"></Setter>
            <Setter Property="CornerRadius" Value="100 10 100 0"></Setter>
            <Setter Property="Padding" Value="10 5"></Setter>
            <Setter Property="Margin" Value="0 0 10 0"></Setter>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <GradientStop Color="#73F4F4F4"/>
                        <GradientStop Color="White" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="ContentControl" x:Key="colorPicker">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                            <ToggleButton Cursor="Hand" x:Name="PopupButton" BorderThickness="0" Height="30" Background="Transparent" Foreground="{StaticResource AccentColorBrush}" VerticalAlignment="Center" Margin="30 0 0 0" IsChecked="{Binding ElementName=Popup, Path=IsOpen}">
                                <ToggleButton.Style>
                                    <Style TargetType="ToggleButton" BasedOn="{StaticResource emptyToggleButton}">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding IsOpen, ElementName=Popup}" Value="True">
                                                <Setter Property="IsEnabled" Value="False" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </ToggleButton.Style>

                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil" Width="24" Height="24">
                                        <materialDesign:PackIcon.Foreground>
                                            <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
                                        </materialDesign:PackIcon.Foreground>
                                    </materialDesign:PackIcon>
                                    <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">SELECT COLOR</TextBlock>
                                </StackPanel>
                            </ToggleButton>
                            <Popup x:Name="Popup" MouseDown="Popup_MouseDown" PopupAnimation="Fade" StaysOpen="False" PlacementTarget="{Binding ElementName=PopupButton}"  Placement="Bottom" AllowsTransparency="True">
                                <Border Background="#E6FFFFFF" Height="250" Width="500" CornerRadius="5" Margin="10">
                                    <Border.Effect>
                                        <DropShadowEffect ShadowDepth="0" BlurRadius="10" />
                                    </Border.Effect>
                                    <Grid>
                                        <Grid Margin="10">
                                            <commonControls:HiveColorPickerControl SelectedColorChanged="HiveColorPickerControl_SelectedColorChanged" SelectedColor="{Binding Color,Mode=TwoWay}" DemoMode="True" />
                                        </Grid>
                                    </Grid>
                                </Border>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <StackPanel>
                <Grid Background="#202020" TextElement.Foreground="Silver">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="0" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding ShowJobStatus}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20">
                        <DockPanel>
                            <Grid DockPanel.Dock="Left" MinWidth="190">
                                <StackPanel Orientation="Horizontal"  Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}">
                                    <ProgressBar  Foreground="#FF6464" Width="30" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
                                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464">
                                <Run Text="Running '"></Run>
                                <Run Text="{Binding RunningJob.Name}"></Run>
                                <Run Text="'..."></Run>
                                    </TextBlock>
                                </StackPanel>
                            </Grid>
                            <StackPanel DockPanel.Dock="Right">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobRemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock>

                                    <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464">
                                        <StackPanel Orientation="Horizontal">
                                            <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" />
                                            <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock>
                                        </StackPanel>
                                    </Button>
                                </StackPanel>
                            </StackPanel>
                            <Grid>
                                <Grid>
                                    <Border VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False">
                                        <Grid ClipToBounds="False" Height="32">
                                            <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid>
                                                            <Grid.Width>
                                                                <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
                                                                    <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding>
                                                                    <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding>
                                                                    <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                                                    <Binding Path="Length"></Binding>
                                                                </MultiBinding>
                                                            </Grid.Width>
                                                            <Rectangle Height="10" VerticalAlignment="Bottom">
                                                                <Rectangle.Fill>
                                                                    <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
                                                                        <Binding Path="."></Binding>
                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding>
                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding>
                                                                    </MultiBinding>
                                                                </Rectangle.Fill>
                                                            </Rectangle>

                                                            <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center">
                                                                <TextBlock FontSize="9" HorizontalAlignment="Right">
                                                                                <Run Text="{Binding Length,Mode=OneWay}"></Run>
                                                                                <Run FontSize="8" Text="m"></Run>
                                                                </TextBlock>
                                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8">
                                                                    <materialDesign:PackIcon.RenderTransform>
                                                                        <RotateTransform Angle="180" />
                                                                    </materialDesign:PackIcon.RenderTransform>
                                                                </materialDesign:PackIcon>
                                                            </StackPanel>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>

                                            <StackPanel Margin="-20 -5 0 0" HorizontalAlignment="Left">
                                                <TextBlock FontSize="9">
                                                                                <Run Text="0"></Run>
                                                                                <Run FontSize="8" Text="m"></Run>
                                                </TextBlock>
                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16">

                                                </materialDesign:PackIcon>
                                            </StackPanel>

                                            <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
                                                <TextBlock FontSize="9">
                                                                                <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run>
                                                                                <Run FontSize="8" Text="m"></Run>
                                                </TextBlock>
                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16">

                                                </materialDesign:PackIcon>
                                            </StackPanel>

                                            <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Bottom" Height="10">

                                            </Border>

                                            <Canvas x:Name="jobProgressCanvas">
                                                <Grid Canvas.Top="0">
                                                    <Canvas.Left>
                                                        <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}">
                                                            <Binding Path="RunningJob" />
                                                            <Binding Path="RunningJobProgress" />
                                                            <Binding ElementName="jobProgressCanvas" Path="ActualWidth" />
                                                        </MultiBinding>
                                                    </Canvas.Left>
                                                    <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Background="#202020" Width="16" Height="16" Margin="-6 0 0 0" />
                                                    <TextBlock Margin="-4 -18 0 0" FontSize="10" Foreground="#FF6464" VerticalAlignment="Top" Background="#202020" Height="18" Text="{Binding RunningJobProgress,StringFormat=0.0}"></TextBlock>
                                                </Grid>
                                            </Canvas>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Grid>
                        </DockPanel>
                    </Border>

                    <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
                </Grid>

                <Grid Background="#C1FFC7">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="0" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsJobCompleted}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>

                    <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5">
                        <DockPanel>
                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                                <materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" />
                                <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Completed Successfully</TextBlock>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
                                <Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
                                    </StackPanel>
                                </Button>
                            </StackPanel>

                            <Grid>

                            </Grid>
                        </DockPanel>
                    </Border>
                </Grid>

                <Grid Background="#FF8888">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="0" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsJobFailed}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>

                    <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5">
                        <DockPanel>
                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                                <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" />
                                <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Failed To Complete</TextBlock>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
                                <!--<Button Height="40" Width="170" Command="{Binding ViewResultsCommand}" Background="#303030" BorderBrush="#202020">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ChartLine" />
                                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">RESULTS</TextBlock>
                                </StackPanel>
                            </Button>-->

                                <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
                                    </StackPanel>
                                </Button>
                            </StackPanel>

                            <Grid>

                            </Grid>
                        </DockPanel>
                    </Border>
                </Grid>

                <Grid Background="#FFE388">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="0" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsJobCanceled}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>

                    <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5">
                        <DockPanel>
                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                                <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" />
                                <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
                                <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
                                    </StackPanel>
                                </Button>
                            </StackPanel>

                            <Grid>

                            </Grid>
                        </DockPanel>
                    </Border>
                </Grid>
            </StackPanel>

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>

                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>

                    <Grid Background="{StaticResource SideBarBackground}" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                        <Grid.Style>
                            <Style TargetType="Grid">
                                <Setter Property="Height" Value="350"></Setter>
                                <Setter Property="LayoutTransform">
                                    <Setter.Value>
                                        <ScaleTransform ScaleX="1" ScaleY="0"></ScaleTransform>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                        <DataTrigger.EnterActions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.EnterActions>
                                        <DataTrigger.ExitActions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.ExitActions>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Grid.Style>

                        <ScrollViewer VerticalScrollBarVisibility="Auto">
                            <StackPanel>
                                <Expander Header="PROCESS PARAMETERS" IsExpanded="True">
                                    <Grid>
                                        <Grid Height="250">
                                            <StackPanel Orientation="Horizontal" Margin="25 0 0 0">

                                                <Border Width="140" Margin="0 0 10 0" Padding="5" CornerRadius="5" BorderThickness="1" BorderBrush="Silver">
                                                    <DockPanel>
                                                        <TextBlock DockPanel.Dock="Top" VerticalAlignment="Center" Padding="2">HISTORY</TextBlock>
                                                        <ListBox Margin="0 10 0 0" ItemsSource="{Binding GroupsHistory}" SelectedItem="{Binding SelectedGroupHistory}">
                                                            <ListBox.ItemTemplate>
                                                                <DataTemplate>
                                                                    <StackPanel>
                                                                        <TextBlock Text="{Binding Name}" FontSize="11" FontWeight="Bold">
                                                                            <TextBlock.Style>
                                                                                <Style TargetType="TextBlock">
                                                                                    <Style.Triggers>
                                                                                        <DataTrigger Binding="{Binding Active}" Value="True">
                                                                                            <Setter Property="Foreground" Value="#FF5F5F"></Setter>
                                                                                            <Setter Property="FontStyle" Value="Italic"></Setter>
                                                                                        </DataTrigger>
                                                                                    </Style.Triggers>
                                                                                </Style>
                                                                            </TextBlock.Style>
                                                                        </TextBlock>
                                                                        <TextBlock Text="{Binding SaveDate}" FontStyle="Italic" Foreground="Gray" FontSize="10"></TextBlock>
                                                                    </StackPanel>
                                                                </DataTemplate>
                                                            </ListBox.ItemTemplate>
                                                        </ListBox>
                                                    </DockPanel>
                                                </Border>
                                                <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" Style="{x:Null}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" SelectedItem="{Binding SelectedProcessParametersTable}" IsEnabled="{Binding RmlProcessParametersTableGroup.Active}">
                                                    <ListBox.ItemContainerStyle>
                                                        <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">

                                                        </Style>
                                                    </ListBox.ItemContainerStyle>
                                                    <ListBox.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <WrapPanel IsItemsHost="True"></WrapPanel>
                                                        </ItemsPanelTemplate>
                                                    </ListBox.ItemsPanel>
                                                    <ListBox.ItemTemplate>
                                                        <DataTemplate DataType="{x:Type observables:ProcessParametersTable}">
                                                            <Border Padding="5" CornerRadius="5" BorderThickness="1" Height="245" Margin="0 0 10 0">
                                                                <Border.Style>
                                                                    <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}">
                                                                        <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                        <Setter Property="Opacity" Value="0.5"></Setter>
                                                                        <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                                <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                                <Setter Property="Background" Value="White"></Setter>
                                                                                <Setter Property="Opacity" Value="1"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </Border.Style>
                                                                <Grid>
                                                                    <DockPanel>
                                                                        <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox>
                                                                        <WrapPanel Orientation="Vertical" Margin="0 5 0 0">
                                                                            <WrapPanel.Resources>
                                                                                <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
                                                                                    <Setter Property="FontSize" Value="10"></Setter>
                                                                                    <Setter Property="Foreground" Value="#7A7A7A"></Setter>
                                                                                    <Setter Property="Margin" Value="0 5 0 5"></Setter>
                                                                                    <Setter Property="MinWidth" Value="80"></Setter>
                                                                                </Style>

                                                                                <Style TargetType="mahapps:NumericUpDown">
                                                                                    <Setter Property="FontFamily" Value="{StaticResource digital-7}"></Setter>
                                                                                </Style>

                                                                                <Style TargetType="ContentControl">
                                                                                    <!--<Setter Property="FontFamily" Value="digital-7"></Setter>-->
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="ContentControl">
                                                                                                <Grid>
                                                                                                    <Border>
                                                                                                        <Border.Style>
                                                                                                            <Style TargetType="Border">
                                                                                                                <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
                                                                                                                <Setter Property="BorderThickness" Value="1"></Setter>
                                                                                                                <Setter Property="Padding" Value="2"></Setter>
                                                                                                                <Setter Property="Margin" Value="5"></Setter>
                                                                                                                <Setter Property="CornerRadius" Value="3"></Setter>
                                                                                                            </Style>
                                                                                                        </Border.Style>
                                                                                                        <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
                                                                                                    </Border>

                                                                                                    <materialDesign:PackIcon HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 0 0 0" Width="12" Height="12" Kind="Settings"></materialDesign:PackIcon>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>


                                                                            </WrapPanel.Resources>
                                                                            <editors:ParameterizedEditor ParameterizedObject="{Binding}">
                                                                                <editors:ParameterizedEditor.ItemsPanel>
                                                                                    <ItemsPanelTemplate>
                                                                                        <WrapPanel IsItemsHost="True" Orientation="Vertical" />
                                                                                    </ItemsPanelTemplate>
                                                                                </editors:ParameterizedEditor.ItemsPanel>
                                                                                <editors:ParameterizedEditor.DoubleTemplate>
                                                                                    <DataTemplate>
                                                                                        <ContentControl>
                                                                                            <StackPanel>
                                                                                                <TextBlock Text="{Binding Name}" FontSize="10"></TextBlock>
                                                                                                <mahapps:NumericUpDown Minimum="0" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown>
                                                                                            </StackPanel>
                                                                                        </ContentControl>
                                                                                    </DataTemplate>
                                                                                </editors:ParameterizedEditor.DoubleTemplate>
                                                                            </editors:ParameterizedEditor>
                                                                        </WrapPanel>
                                                                    </DockPanel>

                                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                                        <TextBlock Text="Active" FontWeight="Bold" FontStyle="Italic" FontSize="13" VerticalAlignment="Center"></TextBlock>
                                                                        <materialDesign:PackIcon Foreground="#90E990" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0">
                                                                            <materialDesign:PackIcon.Style>
                                                                                <Style TargetType="materialDesign:PackIcon">
                                                                                    <Setter Property="Opacity" Value="0"></Setter>
                                                                                    <Style.Triggers>
                                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                                            <DataTrigger.EnterActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.EnterActions>
                                                                                            <DataTrigger.ExitActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.ExitActions>
                                                                                        </DataTrigger>
                                                                                    </Style.Triggers>
                                                                                </Style>
                                                                            </materialDesign:PackIcon.Style>
                                                                        </materialDesign:PackIcon>
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </DataTemplate>
                                                    </ListBox.ItemTemplate>
                                                </ListBox>

                                                <StackPanel Margin="5 0 0 10" VerticalAlignment="Bottom">
                                                    <Button Command="{Binding PushProcessParametersCommand}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignFlatButton}">
                                                        <StackPanel Orientation="Horizontal">
                                                            <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon>
                                                            <TextBlock Margin="10 0 0 0">PUSH PARAMETERS</TextBlock>
                                                        </StackPanel>
                                                    </Button>
                                                    <Button Margin="0 5 0 0" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignFlatButton}">
                                                        <StackPanel Orientation="Horizontal">
                                                            <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon>
                                                            <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock>
                                                        </StackPanel>
                                                    </Button>
                                                </StackPanel>
                                            </StackPanel>
                                        </Grid>

                                        <Grid Background="White">
                                            <Grid.Style>
                                                <Style TargetType="Grid">
                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                    <Style.Triggers>
                                                        <MultiDataTrigger>
                                                            <MultiDataTrigger.Conditions>
                                                                <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                                <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                            </MultiDataTrigger.Conditions>
                                                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                        </MultiDataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Grid.Style>
                                            <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE &amp; MEDIA</TextBlock>
                                        </Grid>
                                    </Grid>
                                </Expander>
                                <Expander Header="CONTROL PARAMETERS" IsExpanded="False">

                                </Expander>
                            </StackPanel>
                        </ScrollViewer>

                        <Rectangle VerticalAlignment="Bottom" Stroke="#CECECE" StrokeThickness="1"></Rectangle>
                    </Grid>


                    <!--Main Grid-->
                    <Grid Grid.Row="1">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="234*"/>
                                <RowDefinition x:Name="graphRowDefinition" Height="80"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="350"/>
                                <ColumnDefinition Width="1*"/>
                            </Grid.ColumnDefinitions>

                            <Grid Grid.ColumnSpan="3">
                                <Grid.Background>
                                    <ImageBrush Opacity="0.4" ImageSource="../Images/White-Background.jpg" Stretch="Fill"></ImageBrush>
                                </Grid.Background>
                            </Grid>


                            <Grid>
                                <Rectangle HorizontalAlignment="Right" StrokeDashArray="5" StrokeThickness="1" Stroke="Silver" Margin="0 40 0 40"></Rectangle>
                                <DockPanel Margin="10">
                                    <StackPanel DockPanel.Dock="Top" >
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="70"></Image>
                                            <TextBlock VerticalAlignment="Center" FontWeight="SemiBold" Margin="10 0 0 0" FontSize="30">MACHINE JOBS</TextBlock>
                                        </StackPanel>

                                        <Rectangle VerticalAlignment="Bottom" StrokeDashArray="7" StrokeThickness="1" Stroke="Silver" Margin="0 8 0 0"></Rectangle>
                                    </StackPanel>
                                    <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF">
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                            <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Job">
                                                <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                            </Button>
                                            <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Job">
                                                <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                            </Button>
                                        </StackPanel>
                                    </Border>
                                    <ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0" HorizontalContentAlignment="Stretch">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel>
                                                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                                                        <Image Source="../Images/rgb.png" Width="32"></Image>

                                                        <StackPanel VerticalAlignment="Center" Margin="10 0 0 0">
                                                            <TextBlock FontWeight="Bold" Text="{Binding Name}"></TextBlock>
                                                            <TextBlock Foreground="Gray" FontStyle="Italic" FontSize="10" Text="{Binding CreationDate}"></TextBlock>
                                                        </StackPanel>
                                                    </StackPanel>

                                                    <ItemsControl HorizontalAlignment="Right" ItemsSource="{Binding Segments}">
                                                        <ItemsControl.ItemsPanel>
                                                            <ItemsPanelTemplate>
                                                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                                                                </StackPanel>
                                                            </ItemsPanelTemplate>
                                                        </ItemsControl.ItemsPanel>
                                                        <ItemsControl.ItemTemplate>
                                                            <DataTemplate>
                                                                <Border Width="25" Height="25" Margin="10 0 0 0" BorderThickness="1" BorderBrush="DimGray" CornerRadius="3">
                                                                    <Border.Background>
                                                                        <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
                                                                            <Binding Path="."></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
                                                                        </MultiBinding>
                                                                    </Border.Background>
                                                                </Border>
                                                            </DataTemplate>
                                                        </ItemsControl.ItemTemplate>
                                                    </ItemsControl>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                                </DockPanel>
                            </Grid>

                            <Grid Grid.Column="1" Margin="10 10 10 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid>
                                    <Grid.IsEnabled>
                                        <MultiBinding Converter="{StaticResource ObjectsNotEqualToBooleanConveter}">
                                            <Binding Path="SelectedJob" />
                                            <Binding Path="RunningJob" />
                                        </MultiBinding>
                                    </Grid.IsEnabled>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="1*"/>
                                    </Grid.RowDefinitions>
                                    <StackPanel>
                                        <Grid>
                                            <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                                <Image Source="../Images/rgb.png" Width="24"></Image>
                                                <TextBlock Margin="5 0 0 0" Text="{Binding SelectedJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
                                            </StackPanel>

                                            <StackPanel Orientation="Horizontal" Margin="0 5 0 0" HorizontalAlignment="Right">
                                                <TextBlock Margin="0 0 5 0" Text="{Binding SelectedJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock>
                                                <Image Source="../Images/calendar.png" Width="16"></Image>
                                            </StackPanel>
                                        </Grid>

                                        <StackPanel Orientation="Horizontal" Margin="0 20 0 0" MaxWidth="940" HorizontalAlignment="Left">
                                            <Border Style="{StaticResource JobFieldBorder}">
                                                <StackPanel Margin="5" Width="140">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="../Images/name.png" Width="32"></Image>
                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock>
                                                    </StackPanel>
                                                    <TextBox Margin="0 3 0 0" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                                                </StackPanel>
                                            </Border>

                                            <Border Style="{StaticResource JobFieldBorder}">
                                                <StackPanel Margin="10 5 5 5" Width="140">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="../Images/wind.png" Width="32"></Image>
                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock>
                                                    </StackPanel>
                                                    <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox>
                                                </StackPanel>
                                            </Border>

                                            <Border Style="{StaticResource JobFieldBorder}">
                                                <StackPanel Margin="20 5 5 5"  Width="140">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="../Images/inter-segment.png" Width="32"></Image>
                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock>
                                                    </StackPanel>
                                                    <DockPanel LastChildFill="True">
                                                        <ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton>
                                                        <mahapps:NumericUpDown StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown>
                                                    </DockPanel>
                                                </StackPanel>
                                            </Border>

                                            <Border Style="{StaticResource JobFieldBorder}">
                                                <StackPanel Margin="20 5 5 5"  Width="140">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="../Images/lubrication.png" Width="32"></Image>
                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock>
                                                    </StackPanel>
                                                    <DockPanel LastChildFill="True" Margin="0 10 0 0">
                                                        <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton>
                                                    </DockPanel>
                                                </StackPanel>
                                            </Border>

                                            <Border Style="{StaticResource JobFieldBorder}" Height="90">
                                                <StackPanel Width="200">
                                                    <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                                                        <Image Source="../Images/description.png" Width="32"></Image>
                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Description</TextBlock>
                                                    </StackPanel>

                                                    <Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5">
                                                        <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding SelectedJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
                                                    </Border>
                                                </StackPanel>
                                            </Border>
                                        </StackPanel>


                                    </StackPanel>

                                    <Grid HorizontalAlignment="Right">
                                        <Button Height="40" Width="170" Margin="0 40 40 5" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobsCommand}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ContentSave" />
                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE JOB</TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </Grid>

                                    <Grid Grid.Row="1" Margin="0 20 0 0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="1*" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="200"/>
                                                <ColumnDefinition Width="1*"/>
                                            </Grid.ColumnDefinitions>

                                            <DockPanel>
                                                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                                                    <Image Source="../Images/segment.png" Width="42"></Image>
                                                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENTS</TextBlock>
                                                </StackPanel>

                                                <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF">
                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                        <Button Command="{Binding RemoveSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment">
                                                            <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                                        </Button>
                                                        <Button Command="{Binding AddSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment">
                                                            <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                                        </Button>
                                                    </StackPanel>
                                                </Border>

                                                <ListBox SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" HorizontalContentAlignment="Stretch">
                                                    <ListBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <DockPanel>
                                                                <StackPanel Orientation="Horizontal" Margin="0 5 0 0" DockPanel.Dock="Left">
                                                                    <Image Source="../Images/segment-single.png" Width="24"></Image>
                                                                    <TextBlock Margin="5 0 0 0" Text="{Binding Name}" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
                                                                </StackPanel>

                                                                <ItemsControl ItemsSource="{Binding BrushStops}" HorizontalAlignment="Right" Margin="0 5 0 0">
                                                                    <ItemsControl.ItemsPanel>
                                                                        <ItemsPanelTemplate>
                                                                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center"></StackPanel>
                                                                        </ItemsPanelTemplate>
                                                                    </ItemsControl.ItemsPanel>
                                                                    <ItemsControl.ItemTemplate>
                                                                        <DataTemplate>
                                                                            <Ellipse Width="8" Height="8" Stroke="DimGray" Margin="5 0 0 0">
                                                                                <Ellipse.Fill>
                                                                                    <SolidColorBrush Color="{Binding Color}" />
                                                                                </Ellipse.Fill>
                                                                            </Ellipse>
                                                                        </DataTemplate>
                                                                    </ItemsControl.ItemTemplate>
                                                                </ItemsControl>
                                                            </DockPanel>
                                                        </DataTemplate>
                                                    </ListBox.ItemTemplate>
                                                </ListBox>
                                            </DockPanel>

                                            <Grid Grid.Column="1" Margin="10 5 0 0">
                                                <DockPanel>
                                                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                                                        <Image Source="../Images/segment-single.png" Width="24"></Image>
                                                        <TextBlock Margin="5 0 0 0" Text="{Binding SelectedSegment.Name,FallbackValue=''}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
                                                    </StackPanel>

                                                    <Grid Margin="0 10 0 0">
                                                        <DockPanel>
                                                            <Grid DockPanel.Dock="Top">
                                                                <Grid>
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Border Style="{StaticResource JobFieldBorder}">
                                                                            <StackPanel Margin="5" Width="140">
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <Image Source="../Images/name.png" Width="32"></Image>
                                                                                    <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock>
                                                                                </StackPanel>
                                                                                <TextBox Margin="0 3 0 0" Text="{Binding SelectedSegment.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                                                                            </StackPanel>
                                                                        </Border>
                                                                        <Border Style="{StaticResource JobFieldBorder}">
                                                                            <StackPanel Margin="5" Width="140">
                                                                                <StackPanel Orientation="Horizontal">
                                                                                    <Image Source="../Images/ruler.png" Width="32"></Image>
                                                                                    <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock>
                                                                                </StackPanel>
                                                                                <mahapps:NumericUpDown FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown>
                                                                            </StackPanel>
                                                                        </Border>
                                                                    </StackPanel>

                                                                    <Grid HorizontalAlignment="Right">
                                                                        <StackPanel Orientation="Horizontal">

                                                                        </StackPanel>
                                                                    </Grid>
                                                                </Grid>
                                                            </Grid>

                                                            <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF">
                                                                <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right">
                                                                    <Button Command="{Binding RemoveBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Color">
                                                                        <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                                                    </Button>
                                                                    <Button Command="{Binding AddBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Color">
                                                                        <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon>
                                                                    </Button>
                                                                </StackPanel>
                                                            </Border>

                                                            <Grid Margin="0 20 0 0">
                                                                <DockPanel>
                                                                    <Grid DockPanel.Dock="Top">
                                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                                                            <Image Source="../Images/color-palette.png" Width="42"></Image>
                                                                            <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock>
                                                                        </StackPanel>

                                                                        <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="8" Margin="200 0 80 0" StrokeThickness="1" Stroke="Gainsboro">
                                                                            <Rectangle.Fill>
                                                                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Name="gradientBrush"></LinearGradientBrush>
                                                                            </Rectangle.Fill>
                                                                        </Rectangle>
                                                                    </Grid>
                                                                    <Grid Margin="0 10 0 0">
                                                                        <ListBox Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" HorizontalContentAlignment="Stretch">
                                                                            <ListBox.ItemContainerStyle>
                                                                                <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">

                                                                                </Style>
                                                                            </ListBox.ItemContainerStyle>
                                                                            <ItemsControl.ItemTemplate>
                                                                                <DataTemplate DataType="{x:Type observables:BrushStop}">

                                                                                    <StackPanel Margin="0 0 0 5">
                                                                                        <Border BorderThickness="1" CornerRadius="5" Padding="10" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop">
                                                                                            <Border.Style>
                                                                                                <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}">
                                                                                                    <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
                                                                                                    <Setter Property="Background" Value="#33FFFFFF"></Setter>
                                                                                                    <Style.Triggers>
                                                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                                                            <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
                                                                                                            <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter>
                                                                                                        </DataTrigger>
                                                                                                    </Style.Triggers>
                                                                                                </Style>
                                                                                            </Border.Style>
                                                                                            <Grid>
                                                                                                <DockPanel>
                                                                                                    <ContentControl DockPanel.Dock="Left">
                                                                                                        <ContentControl.Style>
                                                                                                            <Style TargetType="ContentControl">
                                                                                                                <Setter Property="Content">
                                                                                                                    <Setter.Value>
                                                                                                                        <Rectangle/>
                                                                                                                    </Setter.Value>
                                                                                                                </Setter>
                                                                                                                <Style.Triggers>
                                                                                                                    <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume">
                                                                                                                        <Setter Property="Content">
                                                                                                                            <Setter.Value>
                                                                                                                                <StackPanel VerticalAlignment="Center">
                                                                                                                                    <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center">
                                                                                                                                        <ItemsControl.ItemsPanel>
                                                                                                                                            <ItemsPanelTemplate>
                                                                                                                                                <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
                                                                                                                                            </ItemsPanelTemplate>
                                                                                                                                        </ItemsControl.ItemsPanel>
                                                                                                                                        <ItemsControl.ItemTemplate>
                                                                                                                                            <DataTemplate>
                                                                                                                                                <ContentControl Style="{StaticResource numberBorder}" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                                    <ContentControl.Foreground>
                                                                                                                                                        <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
                                                                                                                                                    </ContentControl.Foreground>
                                                                                                                                                    <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                                        <mahapps:NumericUpDown.Resources>
                                                                                                                                                            <Style TargetType="TextBox"/>
                                                                                                                                                        </mahapps:NumericUpDown.Resources>
                                                                                                                                                    </mahapps:NumericUpDown>
                                                                                                                                                </ContentControl>
                                                                                                                                            </DataTemplate>
                                                                                                                                        </ItemsControl.ItemTemplate>
                                                                                                                                    </ItemsControl>
                                                                                                                                </StackPanel>
                                                                                                                            </Setter.Value>
                                                                                                                        </Setter>
                                                                                                                    </DataTrigger>
                                                                                                                    <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB">
                                                                                                                        <Setter Property="Content">
                                                                                                                            <Setter.Value>
                                                                                                                                <StackPanel Orientation="Horizontal">
                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
                                                                                                                                </StackPanel>
                                                                                                                            </Setter.Value>
                                                                                                                        </Setter>
                                                                                                                    </DataTrigger>
                                                                                                                    <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK">
                                                                                                                        <Setter Property="Content">
                                                                                                                            <Setter.Value>
                                                                                                                                <StackPanel Orientation="Horizontal">
                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="Cyan" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="Magenta" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="Yellow" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
                                                                                                                                        <Rectangle.Fill>
                                                                                                                                            <SolidColorBrush Color="{Binding Color}">
                                                                                                                                            </SolidColorBrush>
                                                                                                                                        </Rectangle.Fill>
                                                                                                                                    </Rectangle>
                                                                                                                                </StackPanel>
                                                                                                                            </Setter.Value>
                                                                                                                        </Setter>
                                                                                                                    </DataTrigger>
                                                                                                                    <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB">
                                                                                                                        <Setter Property="Content">
                                                                                                                            <Setter.Value>
                                                                                                                                <StackPanel Orientation="Horizontal">
                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="Gray" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF8A8A" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="50" Height="50" Margin="10 0 0 0">
                                                                                                                                        <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                                                                                                                            <mahapps:NumericUpDown.Resources>
                                                                                                                                                <Style TargetType="TextBox"/>
                                                                                                                                            </mahapps:NumericUpDown.Resources>
                                                                                                                                        </mahapps:NumericUpDown>
                                                                                                                                    </ContentControl>

                                                                                                                                    <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray">
                                                                                                                                        <Rectangle.Fill>
                                                                                                                                            <SolidColorBrush Color="{Binding Color}">
                                                                                                                                            </SolidColorBrush>
                                                                                                                                        </Rectangle.Fill>
                                                                                                                                    </Rectangle>
                                                                                                                                </StackPanel>
                                                                                                                            </Setter.Value>
                                                                                                                        </Setter>
                                                                                                                    </DataTrigger>
                                                                                                                </Style.Triggers>
                                                                                                            </Style>
                                                                                                        </ContentControl.Style>
                                                                                                    </ContentControl>

                                                                                                    <Grid DockPanel.Dock="Right">
                                                                                                        <Border Style="{StaticResource JobFieldBorder}">
                                                                                                            <StackPanel Margin="5" Width="140">
                                                                                                                <StackPanel Orientation="Horizontal">
                                                                                                                    <Image Source="../Images/colorspace.png" Width="24"></Image>
                                                                                                                    <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock>
                                                                                                                </StackPanel>
                                                                                                                <ComboBox Background="#FCFCFC" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox>
                                                                                                            </StackPanel>
                                                                                                        </Border>
                                                                                                    </Grid>
                                                                                                    <Grid>
                                                                                                        <StackPanel VerticalAlignment="Center">
                                                                                                            <StackPanel.Style>
                                                                                                                <Style TargetType="StackPanel">
                                                                                                                    <Setter Property="Visibility" Value="Hidden"></Setter>
                                                                                                                    <Style.Triggers>
                                                                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedSegment.BrushStops.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=1}" Value="True">
                                                                                                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                                                                                                        </DataTrigger>
                                                                                                                    </Style.Triggers>
                                                                                                                </Style>
                                                                                                            </StackPanel.Style>
                                                                                                            <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center">
                                                                                                                <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> 
                                                                                                                <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run>
                                                                                                                <Run Foreground="Gray" FontSize="9" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={}   ( {0:F1}m )}"></Run>
                                                                                                            </TextBlock>
                                                                                                            <Slider ValueChanged="Offset_Slider_ValueChanged" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}">
                                                                                                                <Slider.Minimum>
                                                                                                                    <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min">
                                                                                                                        <Binding Path="."></Binding>
                                                                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
                                                                                                                        <Binding Path="StopIndex"></Binding>
                                                                                                                    </MultiBinding>
                                                                                                                </Slider.Minimum>
                                                                                                                <Slider.Maximum>
                                                                                                                    <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max">
                                                                                                                        <Binding Path="." Delay="500"></Binding>
                                                                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
                                                                                                                        <Binding Path="StopIndex"></Binding>
                                                                                                                    </MultiBinding>
                                                                                                                </Slider.Maximum>
                                                                                                            </Slider>
                                                                                                        </StackPanel>
                                                                                                    </Grid>
                                                                                                </DockPanel>
                                                                                            </Grid>
                                                                                        </Border>

                                                                                        <StackPanel>
                                                                                            <Grid VerticalAlignment="Top">
                                                                                                <Grid.Style>
                                                                                                    <Style TargetType="Grid">
                                                                                                        <Setter Property="LayoutTransform">
                                                                                                            <Setter.Value>
                                                                                                                <ScaleTransform ScaleX="1" ScaleY="0" />
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                        <Style.Triggers>
                                                                                                            <DataTrigger Binding="{Binding ElementName=toggleExpand, Path=IsChecked}" Value="True">
                                                                                                                <DataTrigger.EnterActions>
                                                                                                                    <BeginStoryboard>
                                                                                                                        <Storyboard>
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2" />
                                                                                                                        </Storyboard>
                                                                                                                    </BeginStoryboard>
                                                                                                                </DataTrigger.EnterActions>
                                                                                                                <DataTrigger.ExitActions>
                                                                                                                    <BeginStoryboard>
                                                                                                                        <Storyboard>
                                                                                                                            <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2" />
                                                                                                                        </Storyboard>
                                                                                                                    </BeginStoryboard>
                                                                                                                </DataTrigger.ExitActions>
                                                                                                            </DataTrigger>
                                                                                                        </Style.Triggers>
                                                                                                    </Style>
                                                                                                </Grid.Style>
                                                                                                <Grid>
                                                                                                    <DataGrid ItemsSource="{Binding LiquidVolumes}" AutoGenerateColumns="False" Background="Transparent">
                                                                                                        <DataGrid.Columns>
                                                                                                            <DataGridTemplateColumn Header="IDS PACK">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <Grid x:Name="t0">
                                                                                                                            <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -11 0 0">
                                                                                                                                <Polygon.Fill>
                                                                                                                                    <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" />
                                                                                                                                </Polygon.Fill>
                                                                                                                            </Polygon>
                                                                                                                            <TextBlock FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock>
                                                                                                                        </Grid>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="DISPENSER NL / PULSE">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding IdsPack.DispenserType.NlPerPulse,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="LIQUID MAX NL / CM">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="VOLUME">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding Volume,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="%" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="FORMULA">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding IdsPack.IdsPackFormula.Name}"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="NL / CM">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="NL / SEC">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                            <DataGridTemplateColumn Header="PULSE / SEC">
                                                                                                                <DataGridTemplateColumn.CellTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                        </TextBlock>
                                                                                                                    </DataTemplate>
                                                                                                                </DataGridTemplateColumn.CellTemplate>
                                                                                                            </DataGridTemplateColumn>
                                                                                                        </DataGrid.Columns>
                                                                                                    </DataGrid>
                                                                                                </Grid>
                                                                                            </Grid>
                                                                                            <ToggleButton Margin="5" x:Name="toggleExpand" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="View more" HorizontalAlignment="Right" Padding="0" Width="24" Height="24" VerticalContentAlignment="Center">
                                                                                                <materialDesign:PackIcon VerticalAlignment="Center">
                                                                                                    <materialDesign:PackIcon.Style>
                                                                                                        <Style TargetType="materialDesign:PackIcon">
                                                                                                            <Setter Property="Kind" Value="ArrowDown"></Setter>
                                                                                                            <Setter Property="Margin" Value="0"></Setter>
                                                                                                            <Style.Triggers>
                                                                                                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}" Value="True">
                                                                                                                    <Setter Property="Kind" Value="ArrowUp"></Setter>
                                                                                                                </DataTrigger>
                                                                                                            </Style.Triggers>
                                                                                                        </Style>
                                                                                                    </materialDesign:PackIcon.Style>
                                                                                                </materialDesign:PackIcon>
                                                                                            </ToggleButton>
                                                                                        </StackPanel>
                                                                                    </StackPanel>
                                                                                </DataTemplate>
                                                                            </ItemsControl.ItemTemplate>
                                                                        </ListBox>
                                                                    </Grid>
                                                                </DockPanel>
                                                            </Grid>
                                                        </DockPanel>
                                                    </Grid>
                                                </DockPanel>
                                            </Grid>
                                        </Grid>

                                        <Grid Height="60" Grid.Row="1">
                                            <DockPanel>
                                                <Grid DockPanel.Dock="Left">
                                                    <StackPanel HorizontalAlignment="Left" Margin="0 0 0 0">
                                                        <TextBlock FontSize="14" Margin="0 20 0 0">
                                                        <Run FontWeight="Bold">ESTIMATED DURATION:</Run>
                                                        <Run FontSize="18" Foreground="{StaticResource AccentColorBrush}" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run>
                                                        </TextBlock>
                                                    </StackPanel>
                                                </Grid>

                                                <Grid DockPanel.Dock="Right">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Button Height="40" Width="170" Command="{Binding StartJobCommand}" Click="OnJobStartClick">
                                                            <StackPanel Orientation="Horizontal">
                                                                <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ClockFast" />
                                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">START</TextBlock>
                                                            </StackPanel>
                                                        </Button>
                                                    </StackPanel>
                                                </Grid>

                                                <Grid Margin="0 -18 0 0">
                                                    <Border VerticalAlignment="Center" Height="35" Margin="30 0 40 0" ClipToBounds="False">
                                                        <Grid ClipToBounds="False">
                                                            <ItemsControl x:Name="jobBrushList" ClipToBounds="False">
                                                                <ItemsControl.ItemsPanel>
                                                                    <ItemsPanelTemplate>
                                                                        <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
                                                                    </ItemsPanelTemplate>
                                                                </ItemsControl.ItemsPanel>
                                                                <ItemsControl.ItemTemplate>
                                                                    <DataTemplate>
                                                                        <Grid>
                                                                            <Grid.Width>
                                                                                <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
                                                                                    <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
                                                                                    <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
                                                                                    <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                                                                    <Binding Path="Length"></Binding>
                                                                                </MultiBinding>
                                                                            </Grid.Width>
                                                                            <Rectangle VerticalAlignment="Bottom" Height="10">
                                                                                <Rectangle.Fill>
                                                                                    <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
                                                                                        <Binding Path="."></Binding>
                                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
                                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
                                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
                                                                                    </MultiBinding>
                                                                                </Rectangle.Fill>
                                                                            </Rectangle>

                                                                            <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center">
                                                                                <TextBlock FontSize="9" HorizontalAlignment="Right">
                                                                                <Run Text="{Binding Length,Mode=OneWay}"></Run>
                                                                                <Run Foreground="Gray" FontSize="8" Text="m"></Run>
                                                                                </TextBlock>
                                                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8" Foreground="DimGray">
                                                                                    <materialDesign:PackIcon.RenderTransform>
                                                                                        <RotateTransform Angle="180" />
                                                                                    </materialDesign:PackIcon.RenderTransform>
                                                                                </materialDesign:PackIcon>
                                                                            </StackPanel>
                                                                        </Grid>
                                                                    </DataTemplate>
                                                                </ItemsControl.ItemTemplate>
                                                            </ItemsControl>

                                                            <StackPanel Margin="-20 -5 0 0" HorizontalAlignment="Left">
                                                                <TextBlock FontSize="9">
                                                                                <Run Text="0"></Run>
                                                                                <Run Foreground="Gray" FontSize="8" Text="m"></Run>
                                                                </TextBlock>
                                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16" Foreground="DimGray">

                                                                </materialDesign:PackIcon>
                                                            </StackPanel>

                                                            <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
                                                                <TextBlock FontSize="9">
                                                                                <Run Text="{Binding SelectedJob.Length,Mode=OneWay}"></Run>
                                                                                <Run Foreground="Gray" FontSize="8" Text="m"></Run>
                                                                </TextBlock>
                                                                <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray">

                                                                </materialDesign:PackIcon>
                                                            </StackPanel>

                                                            <Border BorderBrush="Gainsboro" BorderThickness="1" VerticalAlignment="Bottom" Height="10">

                                                            </Border>
                                                        </Grid>
                                                    </Border>
                                                </Grid>
                                            </DockPanel>
                                        </Grid>
                                    </Grid>
                                </Grid>

                                <Grid Grid.Column="1" Margin="10 0 0 0" Width="340">
                                    <Grid.Style>
                                        <Style TargetType="Grid">
                                            <Setter Property="LayoutTransform">
                                                <Setter.Value>
                                                    <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform>
                                                </Setter.Value>
                                            </Setter>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                                    <DataTrigger.EnterActions>
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </DataTrigger.EnterActions>
                                                    <DataTrigger.ExitActions>
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </DataTrigger.ExitActions>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Grid.Style>

                                    <Grid Margin="5 0 0 0">
                                        <DockPanel x:Name="dockCameras">
                                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                                                <Image Source="../Images/camera.png" Width="42"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">USB CAMERAS</TextBlock>
                                            </StackPanel>

                                            <Grid DockPanel.Dock="Bottom" Height="120" Width="300">
                                                <Border Background="#5DFFFFFF" CornerRadius="10" Padding="5" Margin="0 0 0 10" BorderThickness="1" BorderBrush="Gainsboro">
                                                    <DockPanel>
                                                        <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                                                            <Image Source="../Images/tape.png" Width="25"></Image>
                                                            <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">DATA RECORDER / PLAYER</TextBlock>
                                                        </StackPanel>
                                                        <Grid>
                                                            <DockPanel>
                                                                <DockPanel DockPanel.Dock="Top">
                                                                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" Height="50" VerticalAlignment="Bottom" Margin="0 0 0 5">
                                                                        <Button Command="{Binding MediaLoadCommand}" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="28" Height="28" Background="Transparent" ToolTip="Load Data File">
                                                                            <materialDesign:PackIcon Width="20" Height="20" Kind="Eject" Foreground="{StaticResource AccentColorBrush}" />
                                                                        </Button>
                                                                        <Button Command="{Binding MediaPlayPauseCommand}" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="35" Height="35" Background="Transparent">
                                                                            <materialDesign:PackIcon Width="20" Height="20" Foreground="{StaticResource AccentColorBrush}">
                                                                                <materialDesign:PackIcon.Style>
                                                                                    <Style TargetType="materialDesign:PackIcon">
                                                                                        <Setter Property="Kind" Value="Play"></Setter>
                                                                                        <Style.Triggers>
                                                                                            <MultiDataTrigger>
                                                                                                <MultiDataTrigger.Conditions>
                                                                                                    <Condition Binding="{Binding Player.IsPlaying}" Value="True" />
                                                                                                    <Condition Binding="{Binding Player.IsPaused}" Value="False" />
                                                                                                </MultiDataTrigger.Conditions>
                                                                                                <Setter Property="Kind" Value="Pause"></Setter>
                                                                                            </MultiDataTrigger>
                                                                                        </Style.Triggers>
                                                                                    </Style>
                                                                                </materialDesign:PackIcon.Style>
                                                                            </materialDesign:PackIcon>
                                                                        </Button>
                                                                        <Button Command="{Binding MediaStopCommand}" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="28" Height="28" Background="Transparent">
                                                                            <materialDesign:PackIcon Width="20" Height="20" Kind="Stop" Foreground="{StaticResource AccentColorBrush}" />
                                                                        </Button>
                                                                        <Button Command="{Binding MediaRecordingCommand}" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Foreground="#FF7A7A" BorderBrush="#FF8585" Padding="0" Width="20" Height="20" Background="Transparent" ToolTip="Start Recording">
                                                                            <materialDesign:PackIcon Width="10" Height="10" Kind="Record" />
                                                                        </Button>
                                                                    </StackPanel>
                                                                    <Grid>
                                                                        <TextBlock Margin="0 -5 0 0" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="#FF8585" FontSize="20" FontFamily="{StaticResource digital-7}">
                                                                            <TextBlock.Style>
                                                                                <Style TargetType="TextBlock">
                                                                                    <Setter Property="Opacity" Value="1"></Setter>
                                                                                    <Style.Triggers>
                                                                                        <DataTrigger Binding="{Binding Recorder.IsRecording}" Value="True">
                                                                                            <DataTrigger.EnterActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.EnterActions>
                                                                                            <DataTrigger.ExitActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.ExitActions>
                                                                                        </DataTrigger>
                                                                                    </Style.Triggers>
                                                                                </Style>
                                                                            </TextBlock.Style>
                                                                            <Run Text="{Binding Player.CurrentTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
                                                                            <Run>/</Run>
                                                                            <Run Text="{Binding Player.TotalTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
                                                                        </TextBlock>
                                                                    </Grid>
                                                                </DockPanel>
                                                                <Grid>
                                                                    <Slider Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame}"></Slider>
                                                                    <DockPanel Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                                        <TextBlock DockPanel.Dock="Left">
                                                                            <Run FontWeight="SemiBold" FontStyle="Italic">Total Frames:</Run>
                                                                            <Run FontStyle="Italic" Foreground="#545454" Text="{Binding Recorder.TotalFramesRecorded,StringFormat={}{0:N0},Mode=OneWay,TargetNullValue=0,FallbackValue=0}"></Run>
                                                                        </TextBlock>
                                                                        <TextBlock HorizontalAlignment="Right" Width="140">
                                                                            <Run FontWeight="SemiBold" FontStyle="Italic">File Size:</Run>
                                                                            <Run FontStyle="Italic" Foreground="#545454" Text="{Binding Recorder.TotalBytesRecorded,Mode=OneWay,Converter={StaticResource NumberToFileSizeConverter},TargetNullValue=0,FallbackValue=0}"></Run>
                                                                        </TextBlock>
                                                                    </DockPanel>
                                                                </Grid>
                                                            </DockPanel>
                                                        </Grid>
                                                    </DockPanel>
                                                </Border>
                                            </Grid>

                                            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="0 0 0 10">
                                                <ItemsControl x:Name="listCameras" ItemsSource="{Binding CaptureDevices}" Height="790" Width="320">
                                                    <ItemsControl.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <UniformGrid Rows="3" />
                                                        </ItemsPanelTemplate>
                                                    </ItemsControl.ItemsPanel>

                                                    <ItemsControl.ItemTemplate>
                                                        <DataTemplate DataType="{x:Type video:CaptureDevice}">
                                                            <Border RenderOptions.BitmapScalingMode="Fant">
                                                                <Border.Background>
                                                                    <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush>
                                                                </Border.Background>

                                                                <Grid>
                                                                    <Border Margin="22 24 23 42">
                                                                        <Grid>
                                                                            <Border IsHitTestVisible="False" VerticalAlignment="Center" Padding="10" HorizontalAlignment="Center" Background="#20808080" CornerRadius="5">
                                                                                <TextBlock FontSize="11" Text="{Binding Device.Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter=30,FallbackValue='No Camera',TargetNullValue='No Camera'}"></TextBlock>
                                                                            </Border>

                                                                            <Image Source="{Binding VideoSource,Mode=OneWay,IsAsync=True}" Stretch="Fill" Visibility="{Binding IsStarted,Converter={StaticResource BooleanToVisibilityConverter}}"></Image>

                                                                            <Grid Background="#83000000" Cursor="Hand">
                                                                                <Grid.Style>
                                                                                    <Style TargetType="Grid">
                                                                                        <Setter Property="Opacity" Value="0"></Setter>
                                                                                        <Style.Triggers>
                                                                                            <EventTrigger RoutedEvent="MouseEnter">
                                                                                                <EventTrigger.Actions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </EventTrigger.Actions>
                                                                                            </EventTrigger>
                                                                                            <EventTrigger RoutedEvent="MouseLeave">
                                                                                                <EventTrigger.Actions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </EventTrigger.Actions>
                                                                                            </EventTrigger>
                                                                                        </Style.Triggers>
                                                                                    </Style>
                                                                                </Grid.Style>

                                                                                <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ToggleCameraCommand}" CommandParameter="{Binding}" Style="{StaticResource MaterialDesignFloatingActionMiniButton}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="60" Height="60" Padding="0">
                                                                                    <materialDesign:PackIcon Width="40" Height="40">
                                                                                        <materialDesign:PackIcon.Style>
                                                                                            <Style TargetType="materialDesign:PackIcon">
                                                                                                <Setter Property="Kind" Value="Play"></Setter>
                                                                                                <Style.Triggers>
                                                                                                    <DataTrigger Binding="{Binding IsStarted}" Value="True">
                                                                                                        <Setter Property="Kind" Value="Stop"></Setter>
                                                                                                    </DataTrigger>
                                                                                                    <DataTrigger Binding="{Binding IsStarted}" Value="False">
                                                                                                        <Setter Property="Kind" Value="Play"></Setter>
                                                                                                    </DataTrigger>
                                                                                                </Style.Triggers>
                                                                                            </Style>
                                                                                        </materialDesign:PackIcon.Style>
                                                                                    </materialDesign:PackIcon>
                                                                                </Button>
                                                                            </Grid>
                                                                        </Grid>
                                                                    </Border>
                                                                </Grid>
                                                            </Border>
                                                        </DataTemplate>
                                                    </ItemsControl.ItemTemplate>
                                                </ItemsControl>
                                            </ScrollViewer>
                                        </DockPanel>
                                    </Grid>

                                </Grid>

                            </Grid>

                            <Grid Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource SideBarBackground}">
                                <Grid Margin="10 70 10 10">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="1*"/>
                                        <ColumnDefinition Width="350"/>
                                    </Grid.ColumnDefinitions>

                                    <Grid Grid.Column="1">
                                        <DockPanel>
                                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                                                <Image Source="../Images/graphs.png" Width="42"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">AVAILABLE GRAPHS</TextBlock>
                                            </StackPanel>
                                            <ScrollViewer Margin="0 5 0 0" VerticalScrollBarVisibility="Auto">
                                                <ItemsControl Margin="0 0 5 0" ItemsSource="{Binding AvailableSensors}">
                                                    <ItemsControl.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <UniformGrid Columns="2" IsItemsHost="True"></UniformGrid>
                                                        </ItemsPanelTemplate>
                                                    </ItemsControl.ItemsPanel>
                                                    <ItemsControl.ItemTemplate>
                                                        <DataTemplate DataType="{x:Type observables:Sensor}">
                                                            <Border dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}" Margin="5" CornerRadius="3" Height="120" BorderThickness="1" BorderBrush="Silver" ClipToBounds="True">
                                                                <Border.Background>
                                                                    <ImageBrush ImageSource="../Images/line_graph.png" Stretch="Fill"></ImageBrush>
                                                                </Border.Background>
                                                                <Grid>
                                                                    <Label HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource graphLabel}">
                                                                        <TextBlock Foreground="DimGray" VerticalAlignment="Center" Text="{Binding Description}"></TextBlock>
                                                                    </Label>
                                                                </Grid>
                                                            </Border>
                                                        </DataTemplate>
                                                    </ItemsControl.ItemTemplate>
                                                </ItemsControl>
                                            </ScrollViewer>
                                        </DockPanel>
                                    </Grid>

                                    <Grid>
                                        <Grid Margin="0 0 10 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropAvailableSensor">
                                            <Border>
                                                <ItemsControl ItemsSource="{Binding Graphs}">
                                                    <ItemsControl.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <UniformGrid IsItemsHost="True">
                                                                <UniformGrid.Style>
                                                                    <Style TargetType="UniformGrid">
                                                                        <Setter Property="Columns" Value="1"></Setter>
                                                                        <Setter Property="Rows" Value="1"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=3}" Value="True">
                                                                                <Setter Property="Columns" Value="{Binding Graphs.Count}"></Setter>
                                                                                <Setter Property="Rows" Value="1"></Setter>
                                                                            </DataTrigger>
                                                                            <MultiDataTrigger>
                                                                                <MultiDataTrigger.Conditions>
                                                                                    <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=2}" Value="True"></Condition>
                                                                                    <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=5}" Value="True"></Condition>
                                                                                </MultiDataTrigger.Conditions>
                                                                                <Setter Property="Columns" Value="2"></Setter>
                                                                                <Setter Property="Rows" Value="2"></Setter>
                                                                            </MultiDataTrigger>
                                                                            <MultiDataTrigger>
                                                                                <MultiDataTrigger.Conditions>
                                                                                    <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=4}" Value="True"></Condition>
                                                                                    <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=7}" Value="True"></Condition>
                                                                                </MultiDataTrigger.Conditions>
                                                                                <Setter Property="Columns" Value="3"></Setter>
                                                                                <Setter Property="Rows" Value="2"></Setter>
                                                                            </MultiDataTrigger>
                                                                            <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=6}" Value="True">
                                                                                <Setter Property="Columns" Value="4"></Setter>
                                                                                <Setter Property="Rows" Value="2"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </UniformGrid.Style>
                                                            </UniformGrid>
                                                        </ItemsPanelTemplate>
                                                    </ItemsControl.ItemsPanel>
                                                </ItemsControl>
                                            </Border>
                                            <Grid>
                                                <Grid.Style>
                                                    <Style TargetType="Grid">
                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding Graphs.Count}" Value="0">
                                                                <Setter Property="Visibility" Value="Visible"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Grid.Style>
                                                <TextBlock Foreground="Silver" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30">DRAG &amp; DROP GRAPHS</TextBlock>
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </Grid>

                                <Border VerticalAlignment="Top" Height="50" CornerRadius="0 0 50 50">
                                    <Border.Effect>
                                        <DropShadowEffect BlurRadius="30" ShadowDepth="20" Opacity="0.2" />
                                    </Border.Effect>
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Color="White" Offset="0" />
                                            <GradientStop Color="#FFE6E6E6" Offset="1"/>

                                        </LinearGradientBrush>
                                    </Border.Background>

                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 120 0">
                                        <ToggleButton x:Name="chkGraphs" IsChecked="False"></ToggleButton>
                                        <TextBlock VerticalAlignment="Center" Margin="5 -1 0 0" Foreground="Gray">Display Graphs</TextBlock>
                                    </StackPanel>
                                </Border>
                            </Grid>

                            <!--JOB STATUS-->
                            <Grid Grid.RowSpan="1" Grid.ColumnSpan="2" Width="1570" HorizontalAlignment="Left">
                                <Grid.Background>
                                    <ImageBrush ImageSource="../Images/White-Background.jpg" Stretch="None" />
                                </Grid.Background>
                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Setter Property="RenderTransform">
                                            <Setter.Value>
                                                <ScaleTransform ScaleY="0" ScaleX="1"></ScaleTransform>
                                            </Setter.Value>
                                        </Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ShowJobStatus}" Value="True">
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.5"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.5"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>

                                <DockPanel Margin="60 20 13 13">
                                    <StackPanel Margin="0 20 0 0" Orientation="Horizontal" DockPanel.Dock="Top">
                                        <materialDesign:PackIcon Kind="Settings" Width="60" Height="60" />
                                        <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Job Status</TextBlock>
                                    </StackPanel>

                                    <Grid DockPanel.Dock="Bottom" Height="40">
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 30 0">
                                            <Button Command="{Binding ExportToExcelCommand}" Style="{StaticResource MaterialDesignFlatButton}">
                                                <StackPanel Orientation="Horizontal">
                                                    <materialDesign:PackIcon VerticalAlignment="Center" Kind="FileExcel"></materialDesign:PackIcon>
                                                    <TextBlock Margin="10 0 0 0">EXPORT TO EXCEL</TextBlock>
                                                </StackPanel>
                                            </Button>
                                        </StackPanel>
                                    </Grid>

                                    <Grid>
                                        <DataGrid Background="Transparent" HorizontalAlignment="Left" Width="1450" Margin="0 20 0 10" BorderThickness="1" BorderBrush="Gainsboro">
                                            <DataGrid.Columns>
                                                <DataGridTextColumn Width="Auto" Header="#"/>
                                                <DataGridTextColumn Width="200" Header="TIME STAMP"/>
                                                <DataGridTextColumn Width="100" Header="CODE"/>
                                                <DataGridTextColumn Width="200" Header="NAME"/>
                                                <DataGridTextColumn Width="1*" Header="DESCRIPTION"/>
                                            </DataGrid.Columns>
                                        </DataGrid>
                                    </Grid>
                                </DockPanel>
                            </Grid>

                            <!--MONITORING-->
                            <Grid Grid.ColumnSpan="3" Background="White" Visibility="Visible">
                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Setter Property="RenderTransform">
                                            <Setter.Value>
                                                <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform>
                                            </Setter.Value>
                                        </Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.5"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.5"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40">MONITORING</TextBlock>
                            </Grid>
                        </Grid>
                    </Grid>
                </Grid>

                <Grid Background="{StaticResource SideBarBackground}" IsEnabled="{Binding IsJobRunning,Converter={StaticResource BooleanInverseConverter}}">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="Width" Value="550"></Setter>
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>

                    <ScrollViewer VerticalScrollBarVisibility="Auto" FlowDirection="RightToLeft">
                        <materialDesign:Card Background="{StaticResource SideBarBackground}" FlowDirection="LeftToRight">
                            <StackPanel>
                                <Expander Header="MACHINE" IsExpanded="True" Background="{StaticResource SideBarBackground}">
                                    <StackPanel Margin="0 0 0 0">
                                        <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Machine" Margin="40 0 40 0">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel>
                                                        <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
                                                        <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                        <designer:MachineView Width="540" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" />
                                        <Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon>
                                                <TextBlock Margin="10 0 0 0">EDIT</TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </StackPanel>
                                </Expander>

                                <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" />

                                <Expander Header="MEDIA" Background="{StaticResource SideBarBackground}" IsExpanded="True">
                                    <StackPanel>
                                        <ComboBox DockPanel.Dock="Top" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding SelectedRML}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Thread" Margin="40 0 40 0">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel>
                                                        <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
                                                        <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>

                                        <Button DockPanel.Dock="Bottom" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon>
                                                <TextBlock Margin="10 0 0 0">EDIT</TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </StackPanel>
                                </Expander>

                                <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" />

                                <Expander Background="{StaticResource SideBarBackground}" IsExpanded="True">
                                    <Expander.HeaderTemplate>
                                        <DataTemplate>
                                            <TextBlock><Run>LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock>
                                        </DataTemplate>
                                    </Expander.HeaderTemplate>

                                    <Grid>
                                        <StackPanel Margin="40 0 40 0">
                                            <ItemsControl ItemsSource="{Binding LiquidTypesRmls}">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapPanel IsItemsHost="True"></WrapPanel>
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:LiquidTypesRml}">
                                                        <StackPanel Margin="0 0 10 20">
                                                            <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock>
                                                            <Grid Width="60" Height="50" Margin="0 5 0 0">
                                                                <shapes:Hexagon StrokeThickness="1" Stroke="Gray">
                                                                    <shapes:Hexagon.Fill>
                                                                        <LinearGradientBrush Opacity="0.7" >
                                                                            <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/>
                                                                            <GradientStop Color="White" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </shapes:Hexagon.Fill>
                                                                </shapes:Hexagon>

                                                                <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox>
                                                            </Grid>
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>

                                            <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Margin="0 10 -20 20" Style="{StaticResource MaterialDesignFlatButton}">
                                                <StackPanel Orientation="Horizontal">
                                                    <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon>
                                                    <TextBlock Margin="10 0 0 0">SAVE</TextBlock>
                                                </StackPanel>
                                            </Button>
                                        </StackPanel>

                                        <Grid Height="150" Background="{StaticResource SideBarBackground}">
                                            <Grid.Style>
                                                <Style TargetType="Grid">
                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                    <Style.Triggers>
                                                        <MultiDataTrigger>
                                                            <MultiDataTrigger.Conditions>
                                                                <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                                <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                            </MultiDataTrigger.Conditions>
                                                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                        </MultiDataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Grid.Style>
                                            <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE &amp; MEDIA</TextBlock>
                                        </Grid>
                                    </Grid>
                                </Expander>


                            </StackPanel>
                        </materialDesign:Card>
                    </ScrollViewer>

                    <Rectangle HorizontalAlignment="Right" Stroke="#CECECE" StrokeThickness="1"></Rectangle>
                </Grid>

                <Button Background="Transparent" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0">
                    <Border Background="#F6F6F6" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#C6C0C0">
                        <Grid>
                            <TextBlock Foreground="#FF7272" Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <TextBlock.LayoutTransform>
                                    <RotateTransform Angle="270"></RotateTransform>
                                </TextBlock.LayoutTransform>
                            </TextBlock>
                        </Grid>
                    </Border>
                </Button>
            </Grid>
        </Grid>

        <Grid x:Name="gridFullScreen">
            <Grid.Style>
                <Style TargetType="Grid">
                    <Setter Property="Opacity" Value="0"></Setter>
                    <Setter Property="Visibility" Value="Hidden"></Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding FullScreenGraph,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True">
                            <Setter Property="Visibility" Value="Visible"></Setter>
                            <DataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="Opacity"></DoubleAnimation>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetProperty="Opacity"></DoubleAnimation>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>
            <Grid.Background>
                <SolidColorBrush Color="White" Opacity="0.8"></SolidColorBrush>
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="218*"/>
                <RowDefinition Height="289*"/>
                <RowDefinition Height="213*"/>
            </Grid.RowDefinitions>

            <Grid>
                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40" Text="{Binding FullScreenGraph.SensorName}"></TextBlock>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 30" FontSize="16" Foreground="Gray">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="MouseDown">
                            <i:InvokeCommandAction Command="{Binding ExitFullScreenCommand}"></i:InvokeCommandAction>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <Run> Press </Run> 
                    <Run TextDecorations="Underline" Cursor="Hand">'Escape'</Run>
                    <Run> to exit full screen mode</Run>
                </TextBlock>
            </Grid>

            <Grid Grid.Row="1" Margin="10 0 10 0">
                <ContentControl Content="{Binding FullScreenGraph}"></ContentControl>
            </Grid>
        </Grid>

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