App.xaml.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows;
  4. namespace EfemDualUI
  5. {
  6. /// <summary>
  7. /// Interaction logic for App.xaml
  8. /// </summary>
  9. public partial class App : Application
  10. {
  11. protected override void OnStartup(StartupEventArgs e)
  12. {
  13. Dictionary<int, string> StyleList = new Dictionary<int, string>
  14. {
  15. {1, "Cyan"},
  16. {2, "DeepBlue"},
  17. {3, "GrayBlue"},
  18. {4, "LightBlue"},
  19. {5, "lightgreen"},
  20. {6, "OceanBlue"},
  21. {7, "SeaBlue"},
  22. {8, "SkyBlue"},
  23. {9, "Standard"}
  24. };
  25. string ThemeType = StyleList[6];
  26. //ThemeType = StyleList[1];
  27. //ThemeType = StyleList[9];
  28. string[] resources = new[]
  29. {
  30. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/TextBox.xaml",
  31. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Button.xaml",
  32. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/ComboBox.xaml",
  33. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/MenuItem.xaml",
  34. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Listview.xaml",
  35. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/DataGrid.xaml",
  36. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Tab.xaml",
  37. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/ListBox.xaml",
  38. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/TreeView.xaml",
  39. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/GroupBox.xaml",
  40. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Scrollbar.xaml",
  41. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Expander.xaml",
  42. $@"pack://application:,,,/MECF.Framework.UI.Client;component/Themes/{ThemeType}/Skin.xaml",
  43. };
  44. foreach (var resource in resources)
  45. {
  46. Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
  47. {
  48. Source = new Uri(resource, UriKind.RelativeOrAbsolute)
  49. });
  50. }
  51. FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;
  52. base.OnStartup(e);
  53. }
  54. }
  55. }