Skip to content

Commit 433b5ef

Browse files
authored
Merge pull request #145 from kitUIN/mvvm-settings
[Refactor] Mvvm settings
2 parents 23e40cc + 4068310 commit 433b5ef

10 files changed

Lines changed: 408 additions & 391 deletions

File tree

‎FluentFlyoutWPF/Classes/Settings/SettingsManager.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Diagnostics;
22
using System.IO;
33
using System.Xml.Serialization;
4+
using FluentFlyoutWPF.ViewModels;
45

56
namespace FluentFlyout.Classes.Settings;
67

‎FluentFlyoutWPF/Classes/Settings/UserSettings.cs‎

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

‎FluentFlyoutWPF/Classes/ThemeManager.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static void UpdateTrayIcon()
9696
{
9797
if (Application.Current.MainWindow.FindName("nIcon") is NotifyIcon nIcon)
9898
{
99-
if (SettingsManager.Current.nIconSymbol == true)
99+
if (SettingsManager.Current.NIconSymbol == true)
100100
{
101101
var iconUri = new Uri(WindowsThemeHelper.GetCurrentWindowsTheme() == WindowsTheme.Dark
102102
? "pack://application:,,,/Resources/TrayIcons/FluentFlyoutWhite.png"

‎FluentFlyoutWPF/FluentFlyout.csproj‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>False</UseWindowsForms>
9+
<RootNamespace>FluentFlyoutWPF</RootNamespace>
910
<StartupObject>FluentFlyoutWPF.App</StartupObject>
1011
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
1112
<PlatformTarget>x64</PlatformTarget>
1213
<Platforms>x64</Platforms>
1314
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
15+
<LangVersion>preview</LangVersion>
1416
</PropertyGroup>
1517
<ItemGroup>
1618
<Content Remove="C:\Users\hu8go\.nuget\packages\dubya.windowsmediacontroller\2.5.5\contentFiles\any\net6.0-windows10.0.22000\Icon.ico" />
@@ -30,6 +32,7 @@
3032
<PackageReference Include="System.Drawing.Common" Version="9.0.2" />
3133
<PackageReference Include="WPF-UI" Version="4.0.3" />
3234
<PackageReference Include="WPF-UI.Tray" Version="4.0.3" />
35+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview3" />
3336
</ItemGroup>
3437
<ItemGroup>
3538
<Content Include="Resources\TrayIcons\FluentFlyoutBlack.png">

‎FluentFlyoutWPF/MainWindow.xaml.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,14 +1049,14 @@ private void MicaWindow_Loaded(object sender, RoutedEventArgs e)
10491049

10501050
private void nIcon_LeftClick(Wpf.Ui.Tray.Controls.NotifyIcon sender, RoutedEventArgs e) // change the behavior of the tray icon
10511051
{
1052-
if (SettingsManager.Current.nIconLeftClick == 0)
1052+
if (SettingsManager.Current.NIconLeftClick == 0)
10531053
{
10541054
openSettings(sender, e);
10551055
//Wpf.Ui.Appearance.ApplicationThemeManager.Apply(ApplicationTheme.Light, WindowBackdropType.Mica); // to change the theme
10561056
//ThemeService themeService = new ThemeService();
10571057
//themeService.ChangeTheme(MicaWPF.Core.Enums.WindowsTheme.Light);
10581058
}
1059-
else if (SettingsManager.Current.nIconLeftClick == 1) ShowMediaFlyout();
1059+
else if (SettingsManager.Current.NIconLeftClick == 1) ShowMediaFlyout();
10601060
}
10611061

10621062
private Task PauseOtherSessions(MediaSession currentMediaSession)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace FluentFlyoutWPF.Models;
2+
3+
4+
/// <summary>
5+
/// LanguageOption
6+
/// </summary>
7+
/// <param name="DisplayName"></param>
8+
/// <param name="Tag"></param>
9+
public record LanguageOption(string DisplayName, string Tag);

0 commit comments

Comments
 (0)