-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #953 from shananas/DarkModeToggleTest
Dark Mode Toggle
- Loading branch information
Showing
12 changed files
with
100 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xe.Tools; | ||
|
||
namespace OpenKh.Tools.ModsManager.Services | ||
{ | ||
public class ColorThemeService : BaseNotifyPropertyChanged | ||
{ | ||
public bool DarkMode | ||
{ | ||
get | ||
{ | ||
return ConfigurationService.DarkMode; | ||
} | ||
set | ||
{ | ||
ConfigurationService.DarkMode = value; | ||
|
||
OnPropertyChanged(nameof(DarkMode)); | ||
OnPropertyChanged(nameof(BackgroundColor)); | ||
OnPropertyChanged(nameof(TextColor)); | ||
} | ||
} | ||
|
||
public string BackgroundColor | ||
{ | ||
get | ||
{ | ||
if (DarkMode) | ||
{ | ||
return "#2D2D2D"; | ||
} | ||
else | ||
{ | ||
return "white"; | ||
} | ||
} | ||
} | ||
|
||
public string TextColor | ||
{ | ||
get | ||
{ | ||
if (ConfigurationService.DarkMode) | ||
{ | ||
return "white"; | ||
} | ||
else | ||
{ | ||
return "black"; | ||
} | ||
} | ||
} | ||
|
||
public static readonly ColorThemeService Instance = new ColorThemeService(); | ||
} | ||
} |
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
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
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