【发布时间】:2015-12-01 17:07:17
【问题描述】:
我正在使用 Microsoft Visual Studio Ultimate 2013 使用 WPF 开发一个项目。我正在尝试使用类似于 Visual Studio Dark Theme 的样式,而这篇文章 Visual Studio 2012 Metro Styles for WPF 帮助我实现了这一点。我正在为 Menu、Button、ComboBox、DataGrid、ScrollBar、TextBox 等设置样式,但对于控件页面,我没有找到进入 Metro Style 的方法。
这是我的 app.xaml
Application x:Class="Chem.Managment.Visual.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.Core;component/MetroWindowResources.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Tooltip.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.Core;component/Resources.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/MenuStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/ButtonStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/ComboBoxStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/DataGridStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/GroupBoxStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/ScrollBarStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/TextBoxStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Selen.Wpf.SystemStyles;component/WindowStyles.xaml"/>
<ResourceDictionary Source="ChemResDict.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Button" BasedOn="{StaticResource StandardButton}"/>
<Style TargetType="Window" BasedOn="{StaticResource StandardWindow}"/>
<Style TargetType="Menu" BasedOn="{StaticResource StandardMenu}"/>
<Style TargetType="ScrollBar" BasedOn="{StaticResource StandardScrollBar}"/>
<Style TargetType="TextBox" BasedOn="{StaticResource StandardTextBox}"/>
<Style TargetType="DataGrid" BasedOn="{StaticResource StandardDataGrid}"/>
<Style TargetType="ComboBox" BasedOn="{StaticResource StandardComboBox}"/>
<Style TargetType="GroupBox" BasedOn="{StaticResource StandardGroupBox}"/>
</ResourceDictionary>
</Application.Resources>
</Application>
我尝试在上面的代码中添加页面控件,但不知道怎么做,可能没有实现。
我在这里缺少什么?请有任何建议。 提前致谢
【问题讨论】:
标签: wpf mahapps.metro