-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate from ini app config to json, add theming and config…
… services Signed-off-by: Russell Camo <[email protected]>
- Loading branch information
Showing
15 changed files
with
190 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ | |
|
||
|
||
|
||
|
||
|
||
</ItemGroup> | ||
|
||
|
||
|
12 changes: 12 additions & 0 deletions
12
GroomWise.Infrastructure/Theming/Interfaces/IThemeManagerService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (C) 2023 Russell Camo (Russkyc).- All Rights Reserved | ||
// | ||
// Unauthorized copying or redistribution of all files, in source and binary forms via any medium | ||
// without written, signed consent from the author is strictly prohibited. | ||
|
||
namespace GroomWise.Infrastructure.Theming.Interfaces; | ||
|
||
public interface IThemeManagerService | ||
{ | ||
void SetDarkTheme(bool useDarkTheme); | ||
void SetColorTheme(string themeId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
GroomWise.WPF/Converters/PageContextToSelectionConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (C) 2023 Russell Camo (Russkyc).- All Rights Reserved | ||
// | ||
// Unauthorized copying or redistribution of all files, in source and binary forms via any medium | ||
// without written, signed consent from the author is strictly prohibited. | ||
|
||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace GroomWise.Converters; | ||
|
||
public class PageContextToSelectionConverter : IValueConverter | ||
{ | ||
public static PageContextToSelectionConverter Instance = new(); | ||
|
||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value.GetType() == (Type)parameter; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2023 Russell Camo (Russkyc).- All Rights Reserved | ||
// | ||
// Unauthorized copying or redistribution of all files, in source and binary forms via any medium | ||
// without written, signed consent from the author is strictly prohibited. | ||
|
||
using GroomWise.Infrastructure.Theming.Interfaces; | ||
using Injectio.Attributes; | ||
using org.russkyc.moderncontrols.Helpers; | ||
|
||
namespace GroomWise.Services; | ||
|
||
[RegisterSingleton] | ||
public class ThemeManagerService : IThemeManagerService | ||
{ | ||
public void SetDarkTheme(bool useDarkTheme) | ||
{ | ||
ThemeManager.Instance.SetBaseTheme(useDarkTheme ? "Dark" : "Light"); | ||
} | ||
|
||
public void SetColorTheme(string themeId) | ||
{ | ||
ThemeManager.Instance.SetColorTheme(themeId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.