Skip to content

Commit bd10e28

Browse files
committed
style: cleanup & format
1 parent 0333640 commit bd10e28

File tree

2 files changed

+38
-39
lines changed

2 files changed

+38
-39
lines changed

CrossLaunch/CrossLaunch.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@
3737

3838
<ItemGroup>
3939
<PackageReference Include="AsyncImageLoader.Avalonia" Version="3.3.0"/>
40-
<PackageReference Include="Avalonia" Version="11.2.3" />
41-
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
42-
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
43-
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
40+
<PackageReference Include="Avalonia" Version="11.2.3"/>
41+
<PackageReference Include="Avalonia.Desktop" Version="11.2.3"/>
42+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3"/>
43+
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3"/>
4444
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
4545
<PackageReference Include="Avalonia.Diagnostics" Version="11.2.3">
4646
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
4747
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
4848
</PackageReference>
4949
<PackageReference Include="H.InputSimulator" Version="1.5.0"/>
50-
<PackageReference Include="Serilog" Version="4.2.0" />
51-
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
52-
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
50+
<PackageReference Include="Serilog" Version="4.2.0"/>
51+
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
52+
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
5353
<PackageReference Include="Silk.NET.Input" Version="2.22.0"/>
54-
<PackageReference Include="System.Text.Json" Version="9.0.0" />
54+
<PackageReference Include="System.Text.Json" Version="9.0.0"/>
5555
</ItemGroup>
5656

5757
<ItemGroup>

CrossLaunch/MainWindow.axaml.cs

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Reflection;
32
using Avalonia;
43
using Avalonia.Controls;
@@ -8,6 +7,18 @@ namespace CrossLaunch;
87

98
public 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

Comments
 (0)