3
3
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
4
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5
5
xmlns : atc =" https://github.com/atc-net/atc-wpf/tree/main/schemas"
6
+ xmlns : atcValueConverters =" https://github.com/atc-net/atc-wpf/tree/main/schemas/value-converters"
6
7
xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
8
+ xmlns : dialogs =" clr-namespace:Atc.Installer.Wpf.App.Dialogs"
7
9
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
8
10
Title =" Check for updates"
9
- Width =" 300 "
11
+ Width =" 350 "
10
12
Height =" 250"
11
- Background =" {DynamicResource AtcApps.Brushes.Dialog.Background }"
13
+ d : DataContext =" {d:DesignInstance Type=dialogs:CheckForUpdatesBoxDialogViewModel }"
12
14
ShowCloseButton =" False"
13
15
ShowMaxRestoreButton =" False"
14
16
ShowMinButton =" False"
15
17
WindowStartupLocation =" CenterScreen"
16
18
WindowStyle =" SingleBorderWindow"
17
19
mc : Ignorable =" d" >
18
20
21
+ <atc : NiceWindow .Resources>
22
+ <atcValueConverters : BoolToVisibilityVisibleValueConverter x : Key =" BoolToVisibilityVisibleValueConverter" />
23
+ <atcValueConverters : BoolToVisibilityCollapsedValueConverter x : Key =" BoolToVisibilityCollapsedValueConverter" />
24
+ </atc : NiceWindow .Resources>
25
+
19
26
<atc : GridEx Margin =" 20" Rows =" *,Auto" >
20
27
<atc : UniformSpacingPanel
21
28
Grid.Row=" 0"
26
33
27
34
<StackPanel Orientation =" Horizontal" >
28
35
<TextBlock Text =" Version: " />
29
- <TextBlock x : Name = " VersionTextBlock " Text = " 1.0.0.0 " />
36
+ <TextBlock Text = " {Binding Path=CurrentVersion} " />
30
37
</StackPanel >
31
38
32
- <StackPanel x : Name = " NoVersionUpdatesContainer " Orientation = " Horizontal " >
39
+ <StackPanel Orientation = " Horizontal " Visibility = " {Binding Path=HasNewVersion, Converter={StaticResource BoolToVisibilityCollapsedValueConverter}, FallbackValue=True} " >
33
40
<TextBlock Text =" No new updates." />
34
41
</StackPanel >
35
42
36
- <atc : UniformSpacingPanel
37
- x : Name =" LatestVersionContainer"
38
- Orientation =" Vertical"
39
- Spacing =" 20" >
40
- <StackPanel Orientation =" Horizontal" >
41
- <TextBlock Foreground =" DarkOrange" Text =" Latest version: " />
42
- <TextBlock
43
- x : Name =" LatestVersionTextBlock"
44
- Foreground =" DarkOrange"
45
- Text =" 1.0.0.0" />
46
- </StackPanel >
47
- <TextBlock x : Name =" LatestLinkTextBlock" HorizontalAlignment =" Right" >
48
- <Hyperlink
49
- x : Name =" LatestVersionHyperlink"
50
- Click =" OnLatestVersionHyperlinkClick"
51
- NavigateUri =" ..." >
52
- <Run Text =" Download latest MSI file" />
53
- </Hyperlink >
54
- </TextBlock >
55
- </atc : UniformSpacingPanel >
43
+ <StackPanel Orientation =" Horizontal" Visibility =" {Binding Path=HasNewVersion, Converter={StaticResource BoolToVisibilityVisibleValueConverter}}" >
44
+ <TextBlock Foreground =" DarkOrange" Text =" Latest version: " />
45
+ <TextBlock Foreground =" DarkOrange" Text =" {Binding Path=LatestVersion}" />
46
+ </StackPanel >
56
47
57
48
</atc : UniformSpacingPanel >
58
- <Button
49
+
50
+ <atc : GridEx
59
51
Grid.Row=" 1"
60
- Width =" 100"
61
52
Margin =" 10"
62
- HorizontalAlignment =" Right"
63
- Click =" OnOk"
64
- Content =" OK" />
65
- </atc : GridEx >
53
+ Columns =" *,10,*" >
54
+ <Button
55
+ Grid.Column=" 0"
56
+ Command =" {Binding Path=DownloadLatestCommand}"
57
+ Content =" Download Latest" />
58
+ <Button
59
+ Grid.Column=" 2"
60
+ Click =" OnOk"
61
+ Content =" OK" />
62
+ </atc : GridEx >
66
63
67
- </atc : NiceWindow >
64
+ </atc : GridEx >
68
65
66
+ </atc : NiceWindow >
0 commit comments