-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
13 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
27 changes: 26 additions & 1 deletion
27
VSIX/DevWinUI_Template/WinUIApp-MVVM-NavigationView/Views/Settings/ThemeSettingPage.xaml.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 |
---|---|---|
@@ -1,11 +1,36 @@ | ||
namespace $safeprojectname$.Views; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace $safeprojectname$.Views; | ||
|
||
public sealed partial class ThemeSettingPage : Page | ||
{ | ||
public ThemeSettingPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void OnColorChanged(ColorPicker sender, ColorChangedEventArgs args) | ||
{ | ||
TintBox.Fill = new SolidColorBrush(args.NewColor); | ||
App.Current.GetThemeService.SetBackdropTintColor(args.NewColor); | ||
} | ||
|
||
private void OnColorPaletteItemClick(object sender, ItemClickEventArgs e) | ||
{ | ||
var color = e.ClickedItem as ColorPaletteItem; | ||
if (color != null) | ||
{ | ||
if (color.Hex.Contains("#000000")) | ||
{ | ||
App.Current.GetThemeService.ResetBackdropProperties(); | ||
} | ||
else | ||
{ | ||
App.Current.GetThemeService.SetBackdropTintColor(color.Color); | ||
} | ||
TintBox.Fill = new SolidColorBrush(color.Color); | ||
} | ||
} | ||
} | ||
|
||
|