-
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.
Add GetApplicationTheme and ResetBackdropProperties
Fix Default TintColor ReEnable TintColor Option in Gallery Settings Page
- Loading branch information
Showing
8 changed files
with
99 additions
and
27 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
26 changes: 25 additions & 1 deletion
26
dev/DevWinUI.Gallery/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,35 @@ | ||
namespace DevWinUIGallery.Views; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace DevWinUIGallery.Views; | ||
|
||
public sealed partial class ThemeSettingPage : Page | ||
{ | ||
public ThemeSettingPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
private void ColorPicker_ColorChanged(ColorPicker sender, ColorChangedEventArgs args) | ||
{ | ||
TintBox.Fill = new SolidColorBrush(args.NewColor); | ||
App.Current.GetThemeService.SetBackdropTintColor(args.NewColor); | ||
} | ||
|
||
private void ColorPalette_ItemClick(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); | ||
} | ||
} | ||
} | ||
|
||
|
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