【发布时间】:2016-10-15 19:40:49
【问题描述】:
几天前我开始使用 mahapps(仍在学习),我尝试在标题栏中添加一个图标,我所做的一切都与他们网站上的示例相同,但它不会出现。这就是我正在尝试的:
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<StackPanel Orientation="Horizontal">
<Rectangle Width="20"
Height="20"
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Fill" Visual="{StaticResource appbar_cog}" />
</Rectangle.OpacityMask>
</Rectangle>
<Button Margin="4 0 0 0" Content="settings" Click="Button_Click"/>
</StackPanel>
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>`
还有我的 app.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
<ResourceDictionary Source="/Resources/Icons.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
【问题讨论】:
标签: c# wpf xaml icons mahapps.metro