1- using System ;
21using System . Reflection ;
32using Avalonia ;
43using Avalonia . Controls ;
@@ -8,6 +7,18 @@ namespace CrossLaunch;
87
98public partial class MainWindow : Window
109{
10+ public static readonly StyledProperty < bool > IsUpdateAvailableProperty = AvaloniaProperty . Register < MainWindow , bool > (
11+ nameof ( IsUpdateAvailable )
12+ ) ;
13+
14+ public static readonly StyledProperty < string > CurrentVersionProperty = AvaloniaProperty . Register < MainWindow , string > (
15+ nameof ( CurrentVersion )
16+ ) ;
17+
18+ public static readonly StyledProperty < string > LatestVersionProperty = AvaloniaProperty . Register < MainWindow , string > (
19+ nameof ( LatestVersion )
20+ ) ;
21+
1122 private readonly GitHubService _gitHubService ;
1223
1324 public MainWindow ( )
@@ -20,6 +31,24 @@ public MainWindow()
2031 Load ( ) ;
2132 }
2233
34+ public bool IsUpdateAvailable
35+ {
36+ get => GetValue ( IsUpdateAvailableProperty ) ;
37+ set => SetValue ( IsUpdateAvailableProperty , value ) ;
38+ }
39+
40+ public string CurrentVersion
41+ {
42+ get => GetValue ( CurrentVersionProperty ) ;
43+ set => SetValue ( CurrentVersionProperty , value ) ;
44+ }
45+
46+ public string LatestVersion
47+ {
48+ get => GetValue ( LatestVersionProperty ) ;
49+ set => SetValue ( LatestVersionProperty , value ) ;
50+ }
51+
2352 private async void Load ( )
2453 {
2554 var currentVersion = Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version ? . ToString ( ) ?? string . Empty ;
@@ -39,34 +68,4 @@ private async void Load()
3968 if ( latestVersion != currentVersion )
4069 IsUpdateAvailable = true ;
4170 }
42-
43- public static readonly StyledProperty < bool > IsUpdateAvailableProperty = AvaloniaProperty . Register < MainWindow , bool > (
44- nameof ( IsUpdateAvailable )
45- ) ;
46-
47- public bool IsUpdateAvailable
48- {
49- get => GetValue ( IsUpdateAvailableProperty ) ;
50- set => SetValue ( IsUpdateAvailableProperty , value ) ;
51- }
52-
53- public static readonly StyledProperty < string > CurrentVersionProperty = AvaloniaProperty . Register < MainWindow , string > (
54- nameof ( CurrentVersion )
55- ) ;
56-
57- public string CurrentVersion
58- {
59- get => GetValue ( CurrentVersionProperty ) ;
60- set => SetValue ( CurrentVersionProperty , value ) ;
61- }
62-
63- public static readonly StyledProperty < string > LatestVersionProperty = AvaloniaProperty . Register < MainWindow , string > (
64- nameof ( LatestVersion )
65- ) ;
66-
67- public string LatestVersion
68- {
69- get => GetValue ( LatestVersionProperty ) ;
70- set => SetValue ( LatestVersionProperty , value ) ;
71- }
7271}
0 commit comments