App.xaml.cs 2.8 KB

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