Skip to content

Commit 01e9f21

Browse files
committed
Update Libs and UI Improvements
1 parent d3dae12 commit 01e9f21

21 files changed

+272
-309
lines changed

HandyUpdater/App.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<ResourceDictionary.MergedDictionaries>
1010
<mu:ThemeResources/>
1111
<mu:XamlControlsResources/>
12+
<hc:ThemeResources/>
1213
<hc:Theme/>
1314
</ResourceDictionary.MergedDictionaries>
1415
</ResourceDictionary>

HandyUpdater/HandyUpdater.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="HandyControls" Version="3.0.0" />
11-
<PackageReference Include="ModernWpfUis" Version="1.0.0" />
12-
<PackageReference Include="Downloader" Version="2.0.1" />
10+
<PackageReference Include="HandyControls" Version="3.1.1" />
11+
<PackageReference Include="ModernWpfUis" Version="1.2.0" />
12+
<PackageReference Include="Downloader" Version="2.1.2" />
1313
</ItemGroup>
1414

1515
</Project>

HandyUpdater/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void DownloadService_DownloadFileCompleted(object sender, AsyncCompleted
5151
private void DownloadService_DownloadProgressChanged(object sender, Downloader.DownloadProgressChangedEventArgs e)
5252
{
5353
prgStatus.Value = e.ProgressPercentage;
54-
txtStatus.Text = $"Downloaded {ConvertBytesToMegabytes(e.BytesReceived):N2} MB of {ConvertBytesToMegabytes(e.TotalBytesToReceive):N2} MB - {(int)e.ProgressPercentage} %";
54+
txtStatus.Text = $"Downloaded {ConvertBytesToMegabytes(e.ReceivedBytesSize):N2} MB of {ConvertBytesToMegabytes(e.TotalBytesToReceive):N2} MB - {(int)e.ProgressPercentage} %";
5555
}
5656

5757
double ConvertBytesToMegabytes(long bytes)

HandyWinGet/App.xaml

Lines changed: 121 additions & 13 deletions
Large diffs are not rendered by default.

HandyWinGet/App.xaml.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
using HandyControl.Controls;
2-
using HandyControl.Data;
3-
using HandyControl.Themes;
4-
using HandyControl.Tools;
52
using HandyWinGet.Data;
63
using Microsoft.AppCenter;
74
using Microsoft.AppCenter.Analytics;
85
using Microsoft.AppCenter.Crashes;
9-
using ModernWpf;
106
using System;
117
using System.IO;
128
using System.Runtime;
139
using System.Windows;
10+
using ApplicationTheme = HandyControl.Themes.ApplicationTheme;
1411

1512
namespace HandyWinGet
1613
{
@@ -35,9 +32,9 @@ protected override void OnStartup(StartupEventArgs e)
3532
{
3633
base.OnStartup(e);
3734
GlobalDataHelper<AppConfig>.Init($"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json");
38-
if (GlobalDataHelper<AppConfig>.Config.Skin != SkinType.Default)
35+
if (GlobalDataHelper<AppConfig>.Config.Theme != ApplicationTheme.Light)
3936
{
40-
UpdateSkin(GlobalDataHelper<AppConfig>.Config.Skin);
37+
UpdateSkin(GlobalDataHelper<AppConfig>.Config.Theme);
4138
}
4239

4340
var boot = new Bootstrapper();
@@ -47,14 +44,11 @@ protected override void OnStartup(StartupEventArgs e)
4744
typeof(Analytics), typeof(Crashes));
4845
}
4946

50-
public void UpdateSkin(SkinType skin)
47+
public void UpdateSkin(ApplicationTheme theme)
5148
{
52-
SharedResourceDictionary.SharedDictionaries.Clear();
53-
ResourceHelper.GetTheme("hcTheme", Resources).Skin = skin;
49+
HandyControl.Themes.ThemeManager.Current.ApplicationTheme = theme;
5450

55-
ThemeManager.Current.ApplicationTheme = skin == SkinType.Dark ? ApplicationTheme.Dark : ApplicationTheme.Light;
56-
57-
Current.MainWindow?.OnApplyTemplate();
51+
ModernWpf.ThemeManager.Current.ApplicationTheme = theme == ApplicationTheme.Dark ? ModernWpf.ApplicationTheme.Dark : ModernWpf.ApplicationTheme.Light;
5852
}
5953
}
6054
}

HandyWinGet/Data/AppConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using HandyControl.Controls;
22
using HandyControl.Data;
3+
using HandyControl.Themes;
34
using ModernWpf.Controls;
45
using System;
56

@@ -14,6 +15,6 @@ internal class AppConfig : GlobalDataHelper<AppConfig>
1415
public NavigationViewPaneDisplayMode PaneDisplayMode { get; set; } = NavigationViewPaneDisplayMode.Left;
1516
public InstallMode InstallMode { get; set; } = InstallMode.Wingetcli;
1617
public IdentifyPackageMode IdentifyPackageMode { get; set; } = IdentifyPackageMode.Off;
17-
public SkinType Skin { get; set; } = SkinType.Default;
18+
public ApplicationTheme Theme { get; set; } = ApplicationTheme.Light;
1819
}
1920
}

HandyWinGet/Data/CollectionViewExtension.cs

Lines changed: 0 additions & 151 deletions
This file was deleted.

HandyWinGet/Data/IdentifyPackageMode.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ namespace HandyWinGet.Data
66
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
77
public enum IdentifyPackageMode
88
{
9-
[Description("Off (Fast)")] Off,
9+
[Description("Off (Fast)")]
10+
Off,
1011

1112
[Description("Internal Method (Normal)")]
1213
Internal,

HandyWinGet/Data/InstallMode.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ namespace HandyWinGet.Data
66
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
77
public enum InstallMode
88
{
9-
[Description("Winget-cli")] Wingetcli,
9+
[Description("Winget-cli")]
10+
Wingetcli,
1011

1112
[Description("Internal (Manual installation)")]
1213
Internal

HandyWinGet/Data/ItemEqualityComparer.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)