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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
<UserControl x:Class="Tango.FSE.PPCConsole.Controls.RemoteDesktopControl"
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:global="clr-namespace:Tango.FSE.PPCConsole"
xmlns:vm="clr-namespace:Tango.FSE.PPCConsole.ViewModels"
xmlns:win="clr-namespace:Tango.FSE.Common.WindowsManager;assembly=Tango.FSE.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Tango.FSE.PPCConsole.Controls"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RemoteDesktopViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RemoteDesktopViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" Focusable="False" x:Name="remoteDesktopControl">
<Grid>
<Border CornerRadius="15" BorderBrush="{StaticResource FSE_BorderBrush}" BorderThickness="1">
<Grid>
<Border CornerRadius="1" BorderThickness="30">
<Border.BorderBrush>
<LinearGradientBrush>
<GradientStop Color="#101010" Offset="0" />
<GradientStop Color="#202020" Offset="1" />
</LinearGradientBrush>
</Border.BorderBrush>
<Border BorderThickness="1">
<Border.BorderBrush>
<LinearGradientBrush>
<GradientStop Color="#3E3E3E" Offset="0" />
<GradientStop Color="#101010" Offset="0.5" />
<GradientStop Color="#3E3E3E" Offset="1" />
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Background>
<ImageBrush ImageSource="{StaticResource FSE_PPC_Back}" />
</Border.Background>
<Border>
<Border.Style>
<Style TargetType="Border">
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='/1.6',FallbackValue=500,TargetNullValue=500}"></Setter>
<Setter Property="Height" Value="Auto"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding MachineProvider.MachineOperator.MachineType}" Value="Eureka">
<Setter Property="Width" Value="Auto"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='/1.7',FallbackValue=500,TargetNullValue=500}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Image x:Name="img" FocusVisualStyle="{x:Null}" Focusable="True" Source="{Binding Source}" RenderOptions.BitmapScalingMode="Fant" Stretch="Fill" Visibility="{Binding RemoteDesktopProvider.InSession,Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<Rectangle x:Name="rectSnapshot" Fill="White" IsHitTestVisible="False" Opacity="0"></Rectangle>
</Grid>
</Border>
</Border>
</Border>
<Grid HorizontalAlignment="Right" VerticalAlignment="Top">
<StackPanel Margin="0 5 27 0" Orientation="Horizontal">
<controls:ToggleIconButton Visibility="Collapsed" IsChecked="{Binding TouchMode}" UncheckedIcon="CursorHand" CheckedIcon="CursorHand" UncheckedForeground="{StaticResource FSE_GrayBrush}" CheckedForeground="{StaticResource FSE_GreenBrush}" Cursor="Hand" ToolTip="Touch mode" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="16" Height="16" Padding="0" />
<controls:ToggleIconButton Margin="7 0 0 0" IsChecked="{Binding CursorVisible}" UncheckedIcon="CursorDefault" CheckedIcon="CursorDefault" UncheckedForeground="{StaticResource FSE_GrayBrush}" CheckedForeground="{StaticResource FSE_GreenBrush}" Cursor="Hand" ToolTip="Display remote cursor" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="16" Height="16" Padding="0" />
<controls:IconButton Margin="7 0 0 0" Cursor="Hand" ToolTip="Take snapshot" x:Name="btnSnapshot" Click="BtnSnapshot_Click" Command="{Binding TakeSnapshotCommand}" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Icon="ImagePlus" Width="24" Height="24" Padding="0" />
<controls:IconButton Margin="5 0 0 0" Cursor="Hand" ToolTip="Open in separate window" Icon="OpenInNew" Width="24" Height="24" Padding="0" Command="{Binding WindowsManager.DetachToWindowCommand}" CommandParameter="{Binding ElementName=remoteDesktopControl}" Visibility="{Binding ElementName=remoteDesktopControl,Path=(win:WindowsManagerHelper.IsDetached),Converter={StaticResource BooleanToVisibilityInverseConverter}}" />
</StackPanel>
</Grid>
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30 5 0 0">
<controls:IconButton HorizontalAlignment="Left" Command="{Binding StartRecordingCommand}" ToolTip="Start video recording" Icon="Circle" Width="22" Padding="0" Cursor="Hand" Height="22" Foreground="{StaticResource FSE_RedBrush}" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Visibility="{Binding IsRecording,Converter={StaticResource BooleanToVisibilityInverseConverter}}" />
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Visibility="{Binding IsRecording,Converter={StaticResource BooleanToVisibilityConverter}}">
<Ellipse Width="14" Height="14" Fill="{StaticResource FSE_RedBrush}">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Opacity" Value="0"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsRecording}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Name="blink">
<Storyboard>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="Opacity" FillBehavior="Stop">
<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
<DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="1" />
<DiscreteDoubleKeyFrame KeyTime="00:00:1" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<RemoveStoryboard BeginStoryboardName="blink" />
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<controls:IconButton Margin="5 0 0 0" Padding="0" Cursor="Hand" Command="{Binding StopRecordingCommand}" ToolTip="Stop video recording" Icon="Stop" Width="24" Height="24" Foreground="{StaticResource FSE_RedBrush}" />
<TextBlock Margin="5 0 0 0" Foreground="{StaticResource FSE_RedBrush}" FontFamily="{StaticResource digital-7}" Text="{Binding RecordingTime,StringFormat='hh\\:mm\\:ss'}" VerticalAlignment="Center"></TextBlock>
</StackPanel>
</Grid>
</Grid>
</Border>
</Grid>
</UserControl>
|