App.xaml.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. base.OnStartup(e);
  52. }
  53. }
  54. }