Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Maupin <ermaup@microsoft.com>2019-01-11 00:05:04 +0300
committerEric Maupin <ermaup@microsoft.com>2019-01-11 23:19:25 +0300
commitfeecb39b2869948dccc66a593ce0dab5d1b0a582 (patch)
tree6b36667ea332a38adf6709bfba58a751523242b9 /Xamarin.PropertyEditing.Windows.Standalone
parent747eeefbab8a87ad4789eddc81acf065ee6cee95 (diff)
[Win] Drop ThemeManager
Diffstat (limited to 'Xamarin.PropertyEditing.Windows.Standalone')
-rw-r--r--Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
index 382c1a5..93ddf21 100644
--- a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
+++ b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs
@@ -26,6 +26,8 @@ namespace Xamarin.PropertyEditing.Windows.Standalone
AutoExpandGroups = new[] { "ReadWrite" }
};
+ Application.Current.Resources.MergedDictionaries.Add (DarkTheme);
+
#if USE_VS_ICONS
this.panel.Resources.MergedDictionaries.Add (new ResourceDictionary {
Source = new Uri ("pack://application:,,,/ProppyIcons.xaml", UriKind.RelativeOrAbsolute)
@@ -33,6 +35,13 @@ namespace Xamarin.PropertyEditing.Windows.Standalone
#endif
}
+ private static readonly ResourceDictionary DarkTheme = new ResourceDictionary () {
+ Source = new Uri ("pack://application:,,,/Xamarin.PropertyEditing.Windows;component/Themes/VS.Dark.xaml")
+ };
+ private static readonly ResourceDictionary LightTheme = new ResourceDictionary () {
+ Source = new Uri ("pack://application:,,,/Xamarin.PropertyEditing.Windows;component/Themes/VS.Light.xaml")
+ };
+
private async void Button_Click (object sender, RoutedEventArgs e)
{
object inspectedObject;
@@ -57,15 +66,18 @@ namespace Xamarin.PropertyEditing.Windows.Standalone
private void Theme_Click (object sender, RoutedEventArgs e)
{
if (e.Source is RadioButton rb) {
- switch (rb.Content.ToString()) {
+ switch (rb.Content.ToString ()) {
case "Dark Theme":
- PropertyEditorPanel.ThemeManager.Theme = PropertyEditing.Themes.PropertyEditorTheme.Dark;
+ Application.Current.Resources.MergedDictionaries.Remove (LightTheme);
+ Application.Current.Resources.MergedDictionaries.Add (DarkTheme);
break;
case "Light Theme":
- PropertyEditorPanel.ThemeManager.Theme = PropertyEditing.Themes.PropertyEditorTheme.Light;
+ Application.Current.Resources.MergedDictionaries.Remove (DarkTheme);
+ Application.Current.Resources.MergedDictionaries.Add (LightTheme);
break;
default:
- PropertyEditorPanel.ThemeManager.Theme = PropertyEditing.Themes.PropertyEditorTheme.None;
+ Application.Current.Resources.MergedDictionaries.Remove (LightTheme);
+ Application.Current.Resources.MergedDictionaries.Remove (DarkTheme);
break;
}
}