aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml
blob: ee423e67697ed9d6cee4cbc6c3e20ff3c8e6a5a6 (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
<UserControl x:Class="Tango.MachineStudio.DataCapture.Views.PlayingBarView"
             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:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.MachineStudio.DataCapture.ViewModels"
             xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video"
             xmlns:global="clr-namespace:Tango.MachineStudio.DataCapture"
             xmlns:local="clr-namespace:Tango.MachineStudio.DataCapture.Views"
             mc:Ignorable="d" 
             Width="350" Height="30" Background="{StaticResource AccentColorBrush}" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}">
    <Grid>
        <DockPanel>

            <StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
                <TextBlock VerticalAlignment="Center" FontFamily="{StaticResource digital-7}" Foreground="#F6F6F6" FontSize="20">
                     <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>
            </StackPanel>

            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                <Button Command="{Binding MediaPlayPauseCommand}" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="30" Height="30" Foreground="White">
                    <materialDesign:PackIcon Width="30" Height="30">
                        <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}" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Width="30" Height="30" Foreground="White">
                    <materialDesign:PackIcon Kind="Stop" Width="30" Height="30" />
                </Button>
            </StackPanel>

            <Slider x:Name="slider" VerticalAlignment="Center" Margin="10 0 10 0" Foreground="White" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame,Mode=OneWay}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding MediaSeekHoldCommand}"></i:InvokeCommandAction>
                    </i:EventTrigger>
                    <i:EventTrigger EventName="PreviewMouseUp">
                        <i:InvokeCommandAction Command="{Binding MediaSeekCommand}" CommandParameter="{Binding ElementName=slider,Path=Value}"></i:InvokeCommandAction>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Slider>
        </DockPanel>
    </Grid>
</UserControl>
:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Background" Value="{DynamicResource ToolBarToggleButtonVerticalBackground}"/> <Setter Property="MinHeight" Value="0"/> <Setter Property="MinWidth" Value="0"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,0,3,3" Background="{TemplateBinding Background}"> <Canvas Width="7" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="2,7,2,2" Height="6" HorizontalAlignment="Right"> <!--<Path x:Name="Path1" Data="M 1.5 1 L 1.5 6" Stroke="{DynamicResource ToolBarGripper}"/>--> <Path x:Name="Path2" Data="M 0.5 0 L 0.5 5" Stroke="{DynamicResource ControlForegroundKey}"/> <!--<Path x:Name="Path3" Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" Fill="{DynamicResource ToolBarGripper}"/>--> <Path x:Name="Path4" Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" Fill="{DynamicResource ControlForegroundKey}"/> </Canvas> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> <Trigger Property="IsKeyboardFocused" Value="true"> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource ToolBarGripper}"/> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> </DataTrigger> </Style.Triggers> </Style> <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Background" Value="{DynamicResource ToolBarToggleButtonHorizontalBackground}"/> <Setter Property="MinHeight" Value="0"/> <Setter Property="MinWidth" Value="0"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,3,3,0" Background="{TemplateBinding Background}"> <Canvas Width="6" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="7,2,2,2" Height="7" HorizontalAlignment="Right"> <!--<Path x:Name="Path1" Data="M 1 1.5 L 6 1.5" Stroke="{DynamicResource ControlForegroundKey}"/>--> <Path x:Name="Path2" Data="M 0 0.5 L 5 0.5" Stroke="{DynamicResource ControlForegroundKey}"/> <!--<Path x:Name="Path3" Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" Fill="{DynamicResource ControlForegroundKey}"/>--> <Path x:Name="Path4" Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" Fill="{DynamicResource ControlForegroundKey}"/> </Canvas> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> <Trigger Property="IsKeyboardFocused" Value="true"> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource ToolBarButtonHover}"/> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource ToolBarGripper}"/> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="Stroke" TargetName="Path2" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> <Setter Property="Fill" TargetName="Path4" Value="{DynamicResource Grip.Submenu.Background.Selected}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> </DataTrigger> </Style.Triggers> </Style> <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}"> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="Cursor" Value="SizeAll" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Border Background="Transparent" SnapsToDevicePixels="True"> <Rectangle Margin="0,2" > <Rectangle.Fill> <DrawingBrush Viewport="0,0,4,4" ViewportUnits="Absolute" Viewbox="0,0,8,8" ViewboxUnits="Absolute" TileMode="Tile"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="#FF46464A" Geometry="M 4 4 L 4 8 L 8 8 L 8 4 z" /> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush> </Rectangle.Fill> </Rectangle> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ToolBarMainPanelBorderStyle" TargetType="{x:Type Border}"> <Setter Property="Margin" Value="0,0,11,0"/> <Setter Property="CornerRadius" Value="3,3,3,3"/> <Style.Triggers> <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> <Setter Property="CornerRadius" Value="0,0,0,0"/> </DataTrigger> </Style.Triggers> </Style> <Style x:Key="TangoToolBarStyle" TargetType="{x:Type ToolBar}"> <Setter Property="Background" Value="{DynamicResource ToolBarHorizontalBackground}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolBar}"> <Grid x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true"> <Grid x:Name="OverflowGrid" HorizontalAlignment="Right"> <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{DynamicResource ToolBarHorizontalOverflowButtonStyle}"/> <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false"> <!--<AThemes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">--> <Border x:Name="ToolBarSubMenuBorder" BorderBrush="{DynamicResource ToolBarMenuBorder}" BorderThickness="1" Background="{DynamicResource ToolBarSubMenuBackground}" RenderOptions.ClearTypeHint="Enabled"> <ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel" KeyboardNavigation.DirectionalNavigation="Cycle" FocusVisualStyle="{x:Null}" Focusable="true" Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200"/> </Border> <!--</AThemes:SystemDropShadowChrome>--> </Popup> </Grid> <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{DynamicResource ToolBarMainPanelBorderStyle}"> <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local"> <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/> <ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> <ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </DockPanel> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsOverflowOpen" Value="true"> <Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/> </Trigger> <Trigger Property="Header" Value="{x:Null}"> <Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed"/> </Trigger> <Trigger Property="ToolBarTray.IsLocked" Value="true"> <Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed"/> </Trigger> <Trigger Property="HasDropShadow" SourceName="OverflowPopup" Value="true"> <!--<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/> <Setter Property="SnapsToDevicePixels" TargetName="Shdw" Value="true"/> <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>--> </Trigger> <Trigger Property="Orientation" Value="Vertical"> <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/> <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/> <Setter Property="Height" TargetName="ToolBarThumb" Value="10"/> <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/> <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/> <Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1"/> <Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4"/> <Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2"/> <Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top"/> <Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top"/> <Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch"/> <Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom"/> <Setter Property="Placement" TargetName="OverflowPopup" Value="Right"/> <Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11"/> <Setter Property="Background" Value="{DynamicResource ToolBarVerticalBackground}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> <Setter Property="Background" Value="{DynamicResource ControlBrushColorKey}"/> </DataTrigger> </Style.Triggers> <Style.Resources> <Style TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> <Grid> <Rectangle x:Name="background" Fill="Transparent" Opacity="1"/> <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsDefaulted" Value="true"> <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Fill" TargetName="background" Value="{DynamicResource Toolbar.Button.MaouseMove.Background}"/> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter Property="Fill" TargetName="background" Value="{DynamicResource ControlBrushColorKey}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" TargetName="border" Value="{DynamicResource Button.Disabled.Background}"/> <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Button.Disabled.Border}"/> <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource Button.Disabled.Foreground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Style.Resources> </Style> <Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" TargetType="{x:Type Separator}"> <Setter Property="Width" Value="1" /> <Setter Property="Margin" Value="10,2,10,2" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Separator}"> <Rectangle Fill="{DynamicResource Inactive.Selection}" VerticalAlignment="Stretch"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>