├── docs ├── black.png ├── dark.png ├── light.png └── normalcolor.png ├── DynamicAero2 ├── Replace.txt ├── ThemeColor.cs ├── Brushes │ ├── Black.xaml │ ├── Dark.xaml │ ├── Light.xaml │ └── Material │ │ ├── LightColors.xaml │ │ ├── BlackColors.xaml │ │ └── DarkColors.xaml ├── Theme.xaml.cs ├── Styles │ ├── ContextMenu.xaml.cs │ ├── Menu.xaml │ ├── ToolTip.xaml │ ├── ListBox.xaml │ ├── ProgressBar.xaml │ ├── FocusVisual.xaml │ ├── ListBoxItem.xaml │ ├── StatusBar.xaml │ ├── GroupBox.xaml │ ├── RadioButton.xaml │ ├── Button.xaml │ ├── CheckBox.xaml │ ├── TabControl.xaml │ ├── ComboBoxItem.xaml │ ├── ContextMenu.xaml │ ├── ListViewItem.xaml │ ├── TextBox.xaml │ ├── TabItem.xaml │ ├── Slider.xaml │ ├── ScrollBar.xaml │ └── ListView.xaml ├── DynamicAero2.csproj └── Theme.xaml ├── DynamicAero2.Sample ├── App.xaml.cs ├── DynamicAero2.Sample.csproj ├── App.xaml ├── DataGridItem.cs ├── MainWindow.xaml.cs └── MainWindow.xaml ├── LICENSE ├── DynamicAero2.sln ├── README.md ├── .gitattributes └── .gitignore /docs/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manju-summoner/DynamicAero2/HEAD/docs/black.png -------------------------------------------------------------------------------- /docs/dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manju-summoner/DynamicAero2/HEAD/docs/dark.png -------------------------------------------------------------------------------- /docs/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manju-summoner/DynamicAero2/HEAD/docs/light.png -------------------------------------------------------------------------------- /docs/normalcolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manju-summoner/DynamicAero2/HEAD/docs/normalcolor.png -------------------------------------------------------------------------------- /DynamicAero2/Replace.txt: -------------------------------------------------------------------------------- 1 | (?<=(Brush|Background|Fill|Style|Stroke|Template|Data|Foreground)(="{|"\r?\n?\s*Value="{))StaticResource 2 | 3 | DynamicResource -------------------------------------------------------------------------------- /DynamicAero2/ThemeColor.cs: -------------------------------------------------------------------------------- 1 | namespace DynamicAero2 2 | { 3 | public enum ThemeColor 4 | { 5 | NormalColor, 6 | Black, 7 | Dark, 8 | Light, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DynamicAero2.Sample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DynamicAero2.Sample 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DynamicAero2.Sample/DynamicAero2.Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net10.0-windows 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Black.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Dark.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Light.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DynamicAero2.Sample/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DynamicAero2/Theme.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace DynamicAero2 5 | { 6 | partial class Theme 7 | { 8 | ThemeColor color; 9 | public ThemeColor Color 10 | { 11 | get => color; 12 | set 13 | { 14 | if (color == value) return; 15 | color = value; 16 | SetColor(color); 17 | } 18 | } 19 | 20 | public Theme() 21 | { 22 | InitializeComponent(); 23 | } 24 | void SetColor(ThemeColor color) 25 | { 26 | MergedDictionaries[0] = new ResourceDictionary() { Source = new Uri($"/DynamicAero2;component/Brushes/{color}.xaml", UriKind.Relative) }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DynamicAero2.Sample/DataGridItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Input; 7 | 8 | namespace DynamicAero2.Sample 9 | { 10 | internal class DataGridItem 11 | { 12 | public bool? Check { get; set; } 13 | public string Text { get; set; } 14 | public Key ComboBox { get; set; } 15 | 16 | public static DataGridItem[] Source { get; } = new[] 17 | { 18 | new DataGridItem { Check = true, Text = "Item 1", ComboBox = Key.A }, 19 | new DataGridItem { Check = null, Text = "Item 2", ComboBox = Key.B }, 20 | new DataGridItem { Check = false, Text = "Item 3", ComboBox = Key.C }, 21 | }; 22 | public static Key[] KeySource { get; } = Enum.GetValues(typeof(Key)).Cast().ToArray(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DynamicAero2.Sample/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DynamicAero2.Sample 4 | { 5 | /// 6 | /// Interaction logic for MainWindow.xaml 7 | /// 8 | public partial class MainWindow : Window 9 | { 10 | public MainWindow() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void MenuItem_Click(object sender, RoutedEventArgs e) 16 | { 17 | var theme = Application.Current.Resources.MergedDictionaries[0] as DynamicAero2.Theme; 18 | if (theme is null) return; 19 | 20 | theme.Color = theme.Color switch 21 | { 22 | ThemeColor.NormalColor => ThemeColor.Black, 23 | ThemeColor.Black => ThemeColor.Dark, 24 | ThemeColor.Dark => ThemeColor.Light, 25 | _ => ThemeColor.NormalColor 26 | }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DynamicAero2/Styles/ContextMenu.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Threading; 7 | 8 | namespace DynamicAero2.Styles 9 | { 10 | partial class ContextMenu 11 | { 12 | public ContextMenu() 13 | { 14 | InitializeComponent(); 15 | 16 | AddPrivateControlStyle(typeof(Application).Assembly.GetType("System.Windows.Documents.TextEditorContextMenu+EditorContextMenu"), typeof(System.Windows.Controls.ContextMenu)); 17 | AddPrivateControlStyle(typeof(Application).Assembly.GetType("System.Windows.Documents.TextEditorContextMenu+EditorMenuItem"), typeof(System.Windows.Controls.MenuItem)); 18 | } 19 | void AddPrivateControlStyle(Type targetType, Type baseType) 20 | { 21 | var baseStyle = this[baseType] as Style; 22 | var style = new Style(targetType, baseStyle); 23 | this.Add(targetType, style); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 manju summoner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Material/LightColors.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | #ff050505 5 | #ff0b0b0b 6 | #ff121212 7 | #ff222222 8 | #ff494949 9 | #ff6b6b6b 10 | #ff999999 11 | #ffafafaf 12 | #ffd1d1d1 13 | #ffe5e5e5 14 | #fff6f6f6 15 | 16 | #ffe5eef3 17 | #ff36A2DB 18 | 19 | #e5000000 20 | #b3000000 21 | #50000000 22 | 23 | #ff4CAF50 24 | 25 | #ff5a595b 26 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Material/BlackColors.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | #fffefefe 5 | #fffafafa 6 | #fff5f5f5 7 | #ff656565 8 | #ff212121 9 | #ff090909 10 | #ff000000 11 | 12 | #ff4b4b4b 13 | #ff9c9c9c 14 | #ffc6c6c6 15 | #fff8f8f8 16 | 17 | #ff18394f 18 | #ff11a2ee 19 | 20 | #e5ffffff 21 | #b3ffffff 22 | #50ffffff 23 | 24 | #ff06700c 25 | 26 | #ff414043 27 | -------------------------------------------------------------------------------- /DynamicAero2/Brushes/Material/DarkColors.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | #fffafafa 5 | #fff5f5f5 6 | #ffe0e0e0 7 | #ff757575 8 | #ff424242 9 | #ff303030 10 | #ff212121 11 | 12 | #ff616161 13 | #ff9E9E9E 14 | #ffBDBDBD 15 | #ffEEEEEE 16 | 17 | #ff3b5464 18 | #ff36A2DB 19 | 20 | #e5ffffff 21 | #b3ffffff 22 | #50ffffff 23 | 24 | #ff2E7D32 25 | 26 | #ff5a595b 27 | -------------------------------------------------------------------------------- /DynamicAero2/DynamicAero2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net10.0-windows 5 | True 6 | 7 | ManjuSummoner 8 | DynamicAero2 9 | DynamicResource version of PresentationFramework.Aero2 for .NET Core WPF Application. 10 | MIT 11 | https://github.com/manju-summoner/DynamicAero2 12 | https://github.com/manju-summoner/DynamicAero2 13 | Copyright (c) 2020- ManjuSummoner 14 | WPF XAML Theme UI Dark Light 15 | false 16 | 1.3.0 17 | 18 | 19 | 20 | 21 | $(DefaultXamlRuntime) 22 | Designer 23 | 24 | 25 | Designer 26 | 27 | 28 | $(DefaultXamlRuntime) 29 | Designer 30 | 31 | 32 | Designer 33 | 34 | 35 | Designer 36 | 37 | 38 | Designer 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /DynamicAero2/Styles/Menu.xaml: -------------------------------------------------------------------------------- 1 | 3 | 27 | -------------------------------------------------------------------------------- /DynamicAero2.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30309.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicAero2", "DynamicAero2\DynamicAero2.csproj", "{91DF8CBA-73A7-4AAB-B850-813D84952403}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicAero2.Sample", "DynamicAero2.Sample\DynamicAero2.Sample.csproj", "{4C1AD850-3855-4A6F-938A-11CDF2BED852}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {91DF8CBA-73A7-4AAB-B850-813D84952403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {91DF8CBA-73A7-4AAB-B850-813D84952403}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {91DF8CBA-73A7-4AAB-B850-813D84952403}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {91DF8CBA-73A7-4AAB-B850-813D84952403}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {4C1AD850-3855-4A6F-938A-11CDF2BED852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {4C1AD850-3855-4A6F-938A-11CDF2BED852}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {4C1AD850-3855-4A6F-938A-11CDF2BED852}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {4C1AD850-3855-4A6F-938A-11CDF2BED852}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {F0BE3869-A2A8-4E9F-BF89-830A5C060445} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /DynamicAero2/Theme.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DynamicAero2 2 | DynamicAero2 theme is DynamicResource version of PresentationFramework.Aero2. 3 | 4 | ## Differences from PresentationFramework.Aero2 5 | - All Brush, Style, Template and Data are specified by DynamicResource. 6 | - You can change the color of the control without implementing Style. 7 | ```xaml 8 | 9 | 10 | 11 | ``` 12 | 13 | ## Theme 14 | ### NormalColor 15 | Equivalent to PresentationFramework.Aero2. 16 | ![NormalColor](docs/normalcolor.png) 17 | ### Black 18 | ![Dark](docs/black.png) 19 | ### Dark 20 | ![Dark](docs/dark.png) 21 | ### Light 22 | ![Light](docs/light.png) 23 | 24 | ## Download 25 | [Download Nuget Package](https://www.nuget.org/packages/DynamicAero2/) 26 | 27 | ## How to use 28 | After adding `DynamicAero2.dll` to project reference, edit `App.xaml` as follows. 29 | ```xaml 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ``` 41 | Change the `Color` property to `Dark` or `Light` if necessary. 42 | 43 | ### Theme with style 44 | The theme will not be applied to controls that have Style applied to them. 45 | If you want to use both Style and Theme, you need to set `BasedOn="{StaticResource {x:type Button}}"` to Style. 46 | 47 | #### Correct code 48 | ```xaml 49 |