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
|
<UserControl x:Class="Tango.FSE.Upgrade.Views.ApplicationUpgradeGeneratedView"
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.Upgrade"
xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
xmlns:vm="clr-namespace:Tango.FSE.Upgrade.ViewModels"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.FSE.Upgrade.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:ApplicationUpgradeGeneratedViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ApplicationUpgradeGeneratedViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
<Grid IsEnabled="{Binding IsFree}">
<Grid IsEnabled="{Binding IsCompleted,Converter={StaticResource BooleanInverseConverter}}">
<StackPanel Visibility="{Binding IsCompleted,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<TextBlock FontSize="{StaticResource FSE_LargeFontSize}" Foreground="{StaticResource FSE_GreenBrush}">Full Upgrade Ready!</TextBlock>
<TextBlock Margin="0 10 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="20">
<Run>Your machine application and firmware upgrade is ready.</Run>
</TextBlock>
<StackPanel Visibility="{Binding IsUpgradeNow,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 5 0 0" >
<StackPanel Orientation="Horizontal">
<TextBlock>You have chosen to upgrade the currently connected machine.</TextBlock>
<TextBlock Margin="5 0 0 0" Visibility="{Binding CanUpgradeNow,Converter={StaticResource BooleanToVisibilityConverter}}">press 'upgrade now' to start upgrading remotely.</TextBlock>
<TextBlock Margin="5 0 0 0" Visibility="{Binding CanUpgradeNow,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> That is not currently possible due to the following reason:</TextBlock>
</StackPanel>
<DockPanel Margin="0 8 0 0" Visibility="{Binding CanUpgradeNow,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<material:PackIcon Kind="Alert" Foreground="{StaticResource FSE_WarningBrush}" />
<TextBlock Margin="5 0 0 0" Foreground="{StaticResource FSE_WarningBrush}" Text="{Binding CanUpgradeNowError}"></TextBlock>
</DockPanel>
</StackPanel>
<StackPanel Margin="0 50 0 0">
<RadioButton x:Name="chkUpgradeNow" IsEnabled="{Binding CanUpgradeNow}" IsChecked="{Binding IsUpgradeNowSelected,Mode=TwoWay}" VerticalContentAlignment="Center" Cursor="Hand" Padding="25 0 0 0">
<DockPanel>
<Image Source="../Images/upgrade_remotely.png" Width="48" Height="48" />
<TextBlock Margin="20 0 0 0" VerticalAlignment="Center">I want to upgrade the currently connected machine right now.</TextBlock>
</DockPanel>
</RadioButton>
<CheckBox IsEnabled="{Binding ElementName=chkUpgradeNow,Path=IsChecked}" IsChecked="{Binding SuppressFirmwareUpgrade}" ToolTip="Performs an application upgrade while skipping the firmware upgrade" Background="{StaticResource FSE_WarningBrush}" Margin="105 -5 0 0" FontSize="{StaticResource FSE_SmallFontSize}">Suppress firmware upgrade</CheckBox>
<RadioButton x:Name="chkSaveToDisk" Margin="0 20 0 0" IsChecked="{Binding ElementName=chkUpgradeNow,Path=IsChecked,Converter={StaticResource BooleanInverseConverter},Mode=TwoWay}" VerticalContentAlignment="Center" Cursor="Hand" Padding="25 0 0 0">
<DockPanel>
<Image Source="../Images/flash_drive.png" Width="48" Height="48" />
<TextBlock Margin="20 0 0 0" VerticalAlignment="Center">I will upgrade later using a removable flash drive.</TextBlock>
</DockPanel>
</RadioButton>
</StackPanel>
<StackPanel Margin="60 20 0 0" Width="400" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=chkSaveToDisk,Path=IsChecked}">
<TextBlock>Select where to save the upgrade package (.tup file)</TextBlock>
<DockPanel Margin="0 0 0 0">
<controls:IconButton ToolTip="Browse for .tup file location" Margin="5 0 0 0" DockPanel.Dock="Right" Icon="FolderOpenOutline" Width="38" Height="38" Command="{Binding SelectTupFileLocationCommand}" />
<TextBox FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" IsReadOnly="True" Text="{Binding TupFileLocation}" FlowDirection="RightToLeft" VerticalContentAlignment="Bottom"></TextBox>
</DockPanel>
</StackPanel>
</StackPanel>
<StackPanel Visibility="{Binding IsCompleted,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock FontSize="{StaticResource FSE_LargeFontSize}" Foreground="{StaticResource FSE_GreenBrush}">Full Upgrade Completed!</TextBlock>
<TextBlock Margin="0 10 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="20">
The remote machine should perform the final update operations and automatically reconnect.
</TextBlock>
</StackPanel>
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="1000">
<DockPanel>
<Grid DockPanel.Dock="Right" >
<Button material:ButtonAssist.CornerRadius="25" Visibility="{Binding ElementName=chkUpgradeNow,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding StartUpgradeCommand}" HorizontalAlignment="Right" Width="250" Height="50">
<StackPanel Orientation="Horizontal">
<material:PackIcon Width="32" Height="28" Kind="ClockFast" />
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource FSE_LargeFontSize}">UPGRADE NOW</TextBlock>
</StackPanel>
</Button>
<Button material:ButtonAssist.CornerRadius="25" Command="{Binding SaveTupFileCommand}" Visibility="{Binding ElementName=chkSaveToDisk,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="250" Height="50" VerticalAlignment="Bottom">
<StackPanel Orientation="Horizontal">
<material:PackIcon Width="32" Height="28" Kind="ContentSaveEdit" />
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource FSE_LargeFontSize}">SAVE PACKAGE</TextBlock>
</StackPanel>
</Button>
</Grid>
<StackPanel VerticalAlignment="Bottom" Margin="0 0 40 0">
<TextBlock Text="{Binding Handler.Progress.Message}" TextWrapping="NoWrap" MaxHeight="110" TextTrimming="CharacterEllipsis" ToolTip="{Binding Handler.Progress.Message}" Style="{StaticResource FSE_HandlerStatusTextBlock}"></TextBlock>
<ProgressBar Margin="0 5 0 0" Minimum="0" Maximum="{Binding Handler.Progress.Maximum}" Value="{Binding Handler.Progress.Value}" IsIndeterminate="{Binding Handler.Progress.IsIndeterminate}"></ProgressBar>
</StackPanel>
</DockPanel>
<Rectangle StrokeThickness="1" Stroke="{StaticResource FSE_GrayBrush}" StrokeDashArray="4" Margin="0 10 0 0"></Rectangle>
</StackPanel>
</Grid>
</Grid>
</UserControl>
|