aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/RunningJobViewerEureka.xaml
blob: 39c0321452b7b6105d0ffed93e0e23f62807f5e1 (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
60
61
62
63
64
<UserControl x:Class="Tango.PPC.UI.Controls.RunningJobViewerEureka"
             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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.UI.Controls"
             xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
             mc:Ignorable="d" 
             d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=local:RunningJobViewerEureka, IsDesignTimeCreatable=False}">
    <UserControl.Resources>

    </UserControl.Resources>
    <Grid>
        <touch:SliderContentControl x:Name="slider_control" ThumbColor="{StaticResource TangoPrimaryAccentColor}" 
                                    Height="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=HeightSlider}"
                                    ThumbHeight="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=ThumbHeight}" 
                                    Width="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=Width}"
                                    
                                    Minimum="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=MinimumValue}"
                                    Maximum="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka}, Path=MaximumValue}"
                                    MouseDown="SliderContentControl_MouseDown" TouchDown="SliderContentControl_TouchDown">


            <Border x:Name="brush_border" ClipToBounds="False" CornerRadius="7" Margin="0 0 0 0" Background="{StaticResource TangoLightForegroundBrush}">
                <Border.Clip>
                        <RectangleGeometry RadiusX="7" RadiusY="7">
                            <RectangleGeometry.Rect>
                                <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                    <Binding ElementName="brush_border" Path="ActualWidth"  />
                                    <Binding ElementName="brush_border" Path="ActualHeight"  />
                                </MultiBinding>
                            </RectangleGeometry.Rect>
                        </RectangleGeometry>
                    </Border.Clip>
                <Grid>
                    <ItemsControl ClipToBounds="False" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=local:RunningJobViewerEureka},Path=RunningJobStatus.CurrentUnitSegments, Delay=100}">
                        <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="RunningJobStatus.CurrentUnitTotalProgress"></Binding>
                                            <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                            <Binding Path="LengthWithFactor"></Binding>
                                        </MultiBinding>
                                    </Grid.Width>
                                    <Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>

                    <Rectangle Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="7" RadiusY="7" />
                </Grid>
            </Border>
        </touch:SliderContentControl>
    </Grid>
</UserControl>