-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathSimulateView.axaml
More file actions
86 lines (82 loc) · 5.91 KB
/
Copy pathSimulateView.axaml
File metadata and controls
86 lines (82 loc) · 5.91 KB
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
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:GeneralUpdate.Tools.ViewModels"
xmlns:svc="using:GeneralUpdate.Tools.Services"
x:Class="GeneralUpdate.Tools.Views.SimulateView"
x:Name="SimRoot"
x:DataType="vm:SimulateViewModel">
<ScrollViewer>
<StackPanel Margin="28,24" Spacing="14">
<TextBlock Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.Title]}"
FontSize="20" FontWeight="Bold"/>
<!-- Test target -->
<Border Padding="16" CornerRadius="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
<StackPanel Spacing="10">
<TextBlock Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.TestTarget]}"
FontSize="14" FontWeight="SemiBold"/>
<Grid ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.OldAppDir]}"
VerticalAlignment="Center" Width="100"/>
<TextBox Grid.Column="1" Text="{Binding Config.AppDirectory}" IsReadOnly="True" Margin="8,0"/>
<Button Grid.Column="2" Content="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.Select]}"
Command="{Binding SelectAppDirCommand}" MinWidth="80"/>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.PatchFile]}"
VerticalAlignment="Center" Width="100"/>
<TextBox Grid.Column="1" Text="{Binding Config.PatchFilePath}" IsReadOnly="True" Margin="8,0"/>
<Button Grid.Column="2" Content="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.Select]}"
Command="{Binding SelectPatchCommand}" MinWidth="80"/>
</Grid>
</StackPanel>
</Border>
<!-- Config -->
<Border Padding="16" CornerRadius="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
<StackPanel Spacing="10">
<TextBlock Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.UpdateConfig]}"
FontSize="14" FontWeight="SemiBold"/>
<Grid ColumnDefinitions="Auto,*,Auto,*">
<TextBlock Grid.Column="0" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.CurrentVer]}"
VerticalAlignment="Center"/>
<TextBox Grid.Column="1" Text="{Binding Config.CurrentVersion}" Margin="8,0,16,0"/>
<TextBlock Grid.Column="2" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.TargetVer]}"
VerticalAlignment="Center"/>
<TextBox Grid.Column="3" Text="{Binding Config.TargetVersion}" Margin="8,0"/>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto,*">
<TextBlock Grid.Column="0" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.Platform]}"
VerticalAlignment="Center"/>
<ComboBox x:Name="PlatformCombo" Grid.Column="1" ItemsSource="{Binding Platforms}"
SelectedIndex="0" Margin="8,0,16,0"/>
<TextBlock Grid.Column="2" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.AppType]}"
VerticalAlignment="Center"/>
<ComboBox x:Name="AppTypeCombo" Grid.Column="3" ItemsSource="{Binding AppTypes}"
SelectedIndex="0" Margin="8,0"/>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto,*">
<TextBlock Grid.Column="0" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.AppSecret]}"
VerticalAlignment="Center"/>
<TextBox Grid.Column="1" Text="{Binding Config.AppSecretKey}" Margin="8,0,16,0"/>
<TextBlock Grid.Column="2" Text="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Sim.ProductId]}"
VerticalAlignment="Center"/>
<TextBox Grid.Column="3" Text="{Binding Config.ProductId}" Margin="8,0"/>
</Grid>
</StackPanel>
</Border>
<!-- Run -->
<Button Content="{Binding StartButtonText}"
Command="{Binding StartSimulationCommand}"
IsEnabled="{Binding !IsRunning}" Height="40" FontSize="14" HorizontalAlignment="Stretch"/>
<ProgressBar IsVisible="{Binding IsRunning}" IsIndeterminate="True" Height="4"/>
<TextBlock Text="{Binding Status}" FontSize="13"/>
<!-- Log -->
<Border Padding="10" CornerRadius="6" Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" MaxHeight="200">
<ListBox ItemsSource="{Binding Log}" Background="Transparent" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate><TextBlock Text="{Binding}" FontSize="11" FontFamily="Consolas,monospace"/></DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>