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

namespace Tango.Touch.Keyboard
{
    
<UserControl x:Class="Tango.FSE.PPCConsole.Views.RemoteDesktopView"
             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:global="clr-namespace:Tango.FSE.PPCConsole"
             xmlns:vm="clr-namespace:Tango.FSE.PPCConsole.ViewModels"
             xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common"
             xmlns:local="clr-namespace:Tango.FSE.PPCConsole.Views"
             xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:console="clr-namespace:Tango.Console;assembly=Tango.Console"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:RemoteDesktopViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RemoteDesktopViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}" Focusable="False">
    <Grid IsEnabled="{Binding IsFree}">
        <DockPanel IsEnabled="{Binding MachineProvider.IsPPCAvailable}">
            <Border DockPanel.Dock="Right" 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 Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='/1.6',FallbackValue=500,TargetNullValue=500}">
                                <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>
                            </Border>
                        </Border>
                    </Border>

                    <Grid IsHitTestVisible="False">
                        <material:PackIcon Visibility="{Binding RemoteDesktopProvider.IsWebRtcActive,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="LightningBoltCircle" HorizontalAlignment="Right" VerticalAlignment="Top" Width="16" Height="16" Margin="10 8 30 10" Foreground="{StaticResource FSE_GreenBrush}" />
                    </Grid>
                </Grid>
            </Border>

            <Grid>
                <DockPanel>
                    <DockPanel.Style>
                        <Style TargetType="DockPanel">
                            <Setter Property="Margin" Value="0 100 100 50"></Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding ResolutionService.IsLowResolution}" Value="True">
                                    <Setter Property="Margin" Value="0 20 100 0"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </DockPanel.Style>
                    <StackPanel DockPanel.Dock="Top">
                        <DockPanel>
                            <TextBlock VerticalAlignment="Center" FontStyle="Italic" FontSize="{StaticResource FSE_ModuleHeaderFontSize}">REMOTE DESKTOP</TextBlock>
                            <Viewbox Stretch="Uniform" HorizontalAlignment="Right" Margin="0 0 100 0">
                                <Viewbox.Style>
                                    <Style TargetType="Viewbox">
                                        <Setter Property="Width" Value="100"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ResolutionService.IsLowResolution}" Value="True">
                                                <Setter Property="Width" Value="50"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Viewbox.Style>
                                <Grid Width="100" Height="100">
                                    <Image Source="{StaticResource  FSE_Machine_Full}" VerticalAlignment="Top" HorizontalAlignment="Right" RenderOptions.BitmapScalingMode="Fant" Width="90" Stretch="Uniform" />
                                    <Image Source="../Images/desktop.png" Stretch="Uniform" Width="60" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
                                </Grid>
                            </Viewbox>
                        </DockPanel>
                        <Rectangle StrokeThickness="1" Stroke="{StaticResource FSE_BorderBrush}" Height="1" StrokeDashArray="4" Margin="0 20 0 0" />
                    </StackPanel>
                    <Grid>
                        <DockPanel Margin="0 20 0 0">
                            <StackPanel DockPanel.Dock="Top">
                                <TextBlock TextWrapping="Wrap">
                                    <Run>Remote desktop allows you to view and control the currently connected machine tablet PC screen.</Run>
                                    <LineBreak/>
                                    <Run>Press 'start' to start a remote desktop session.</Run>
                                </TextBlock>
                            </StackPanel>
                            <Grid DockPanel.Dock="Bottom">

                                <Grid HorizontalAlignment="Left">
                                    <Grid.Style>
                                        <Style TargetType="Grid">
                                            <Setter Property="Margin" Value="0 0 0 0"></Setter>
                                            <Setter Property="VerticalAlignment" Value="Bottom"></Setter>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding ResolutionService.IsLowResolution}" Value="True">
                                                    <Setter Property="VerticalAlignment" Value="Top"></Setter>
                                                    <Setter Property="Margin" Value="0 -40 0 0"></Setter>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Grid.Style>

                                    <StackPanel Orientation="Horizontal">
                                        <material:PackIcon>
                                            <material:PackIcon.Style>
                                                <Style TargetType="material:PackIcon">
                                                    <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryBackgroundLighterBrush}"></Setter>
                                                    <Setter Property="Kind" Value="Circle"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RemoteDesktopProvider.InSession}" Value="True">
                                                            <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding RemoteDesktopProvider.IsWebRtcActive}" Value="True">
                                                            <Setter Property="Kind" Value="LightningBoltCircle"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </material:PackIcon.Style>
                                        </material:PackIcon>
                                        <TextBlock Margin="10 0 0 0">
                                            <TextBlock.Style>
                                                <Style TargetType="TextBlock">
                                                    <Setter Property="Text" Value="Remote desktop disabled. No active machine connection."></Setter>
                                                    <Setter Property="Foreground" Value="{StaticResource FSE_BorderBrush}"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding MachineProvider.IsConnected}" Value="False">
                                                            <Setter Property="Text" Value="Remote desktop disabled. No active machine connection."></Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding MachineProvider.IsConnected}" Value="True">
                                                            <Setter Property="Text" Value="Remote desktop session is ready to start."></Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding RemoteDesktopProvider.InSession}" Value="True">
                                                            <Setter Property="Text" Value="Remote desktop session is active."></Setter>
                                                            <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding RemoteDesktopProvider.IsWebRtcActive}" Value="True">
                                                            <Setter Property="Text" Value="Remote desktop session is active using a fast communication channel."></Setter>
                                                        </DataTrigger>                                                        
                                                    </Style.Triggers>
                                                </Style>
                                            </TextBlock.Style>
                                        </TextBlock>
                                    </StackPanel>
                                </Grid>
                                
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Height="50">
                                        <controls:TextIconButton material:ButtonAssist.CornerRadius="25" Icon="Stop" Padding="0 12" Width="200" Command="{Binding StopCommand}" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Grid.Column="1" Style="{StaticResource FSE_TextIconButton_Dark}">STOP</controls:TextIconButton>
                                    <controls:TextIconButton material:ButtonAssist.CornerRadius="25" Icon="Play" Padding="0 12" Width="200" Command="{Binding StartCommand}" IsEnabled="{Binding RemoteDesktopProvider.CanStartSession}" Grid.Column="2" Margin="10 0 0 0" Height="Auto">START</controls:TextIconButton>
                                </StackPanel>
                            </Grid>
                            <Grid>
                                <StackPanel Margin="0 40 0 0">
                                    <TextBlock FontStyle="Italic" Foreground="{StaticResource FSE_PrimaryAccentBrush}" FontSize="{StaticResource FSE_LargeFontSize}">Actions</TextBlock>

                                    <UniformGrid Margin="0 10 0 0" HorizontalAlignment="Left">
                                        <UniformGrid.Style>
                                            <Style TargetType="UniformGrid">
                                                <Setter Property="Rows" Value="3"></Setter>
                                                <Setter Property="Columns" Value="1"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ResolutionService.IsLowResolution}" Value="True">
                                                        <Setter Property="Columns" Value="2"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </UniformGrid.Style>
                                        <Button IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Hide PPC and Open Shell" Command="{Binding HideAndOpenShellCommand}" />

                                        <Button IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Restart application"/>

                                        <Button IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="250" Margin="5" Style="{StaticResource FSE_Button_Polygon}" Content="Open Task Manager" Command="{Binding OpenTaskManagerCommand}" />

                                        <CheckBox Margin="5" HorizontalAlignment="Center" IsEnabled="{Binding RemoteDesktopProvider.InSession,Converter={StaticResource BooleanInverseConverter}}" IsChecked="{Binding RemoteDesktopProvider.EnableWebRtc}">Enable fast communication channel</CheckBox>
                                    </UniformGrid>
                                </StackPanel>
                            </Grid>
                        </DockPanel>
                    </Grid>
                </DockPanel>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>