Wpf Metro UI标题栏窗口状态(最小/恢复/关闭)图示符
我正在构建一个WPF应用程序,并创建一个没有标准标题栏的用户界面。说到这里,我需要处理我自己的WindowsState按钮,我认为metroUI/Vs2012使用的按钮将是理想的。我遇到的问题是找到图示符(图标),以便将它们添加到按钮中。我用snoop检查了vs2012,除了它确实使用字体符号,而不是图标的图像之外,找不到什么。我检查了Segoe用户界面,它似乎不包含这些。人们到底用什么来创建他们的metro ui标题栏按钮图标 最坏的情况下,我将打开一个metro应用程序,取一些屏幕帽,然后在illustrator中回溯图示符,然后将向量导入blend以转换为XAML。或者我甚至可以只剪切图标并使用按钮中的图像,尽管我更喜欢使用字体字形或xaml解决方案Wpf Metro UI标题栏窗口状态(最小/恢复/关闭)图示符,wpf,xaml,icons,expression-blend,Wpf,Xaml,Icons,Expression Blend,我正在构建一个WPF应用程序,并创建一个没有标准标题栏的用户界面。说到这里,我需要处理我自己的WindowsState按钮,我认为metroUI/Vs2012使用的按钮将是理想的。我遇到的问题是找到图示符(图标),以便将它们添加到按钮中。我用snoop检查了vs2012,除了它确实使用字体符号,而不是图标的图像之外,找不到什么。我检查了Segoe用户界面,它似乎不包含这些。人们到底用什么来创建他们的metro ui标题栏按钮图标 最坏的情况下,我将打开一个metro应用程序,取一些屏幕帽,然后在
做过这件事的人能给我指引正确的方向吗?以下是我找到的一件的基本知识。我们在工作中只使用带有这些符号的windows字体类型,但是wpf的现代UI没有路径。完整的代码可以在下面的链接中找到,这只是足够的代码来显示它的工作
这太完美了,正是我想要的。还有,你们还记得你们用什么字体吗?
<Style x:Key="SystemButtonBase" TargetType="ButtonBase">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Border Name="Chrome"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
SnapsToDevicePixels="true">
<ContentPresenter Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SystemButton" TargetType="ButtonBase" BasedOn="{StaticResource SystemButtonBase}">
<Setter Property="Foreground" Value="{DynamicResource LinkButtonText}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource LinkButtonTextHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" Value="{DynamicResource LinkButtonTextPressed}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource LinkButtonTextDisabled}" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,8,6,0" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Command="{Binding Source={x:Static SystemCommands.MinimizeWindowCommand}}" Style="{StaticResource SystemButton}">
<Button.Content>
<Grid Width="13" Height="12" RenderTransform="1,0,0,1,0,1">
<Path Data="M0,6 L8,6 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="2" />
</Grid>
</Button.Content>
</Button>
<Grid Margin="1,0,1,0">
<Button x:Name="Restore" Command="{Binding Source={x:Static SystemCommands.RestoreWindowCommand}}" Visibility="Collapsed" Style="{StaticResource SystemButton}" >
<Button.Content>
<Grid Width="13" Height="12" UseLayoutRounding="True" RenderTransform="1,0,0,1,.5,.5">
<Path Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z" Width="8" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="1" />
</Grid>
</Button.Content>
</Button>
<Button x:Name="Maximize" Command="{Binding Source={x:Static SystemCommands.MaximizeWindowCommand}}" Style="{StaticResource SystemButton}" >
<Button.Content>
<Grid Width="13" Height="12">
<Path Data="M0,1 L9,1 L9,8 L0,8 Z" Width="9" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="2" />
</Grid>
</Button.Content>
</Button>
</Grid>
<Button Command="{Binding Source={x:Static SystemCommands.CloseWindowCommand}}" Style="{StaticResource SystemButton}" >
<Button.Content>
<Grid Width="13" Height="12" RenderTransform="1,0,0,1,0,1">
<Path Data="M0,0 L8,7 M8,0 L0,7 Z" Width="8" Height="7" VerticalAlignment="Center" HorizontalAlignment="Center"
Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}" StrokeThickness="1.5" />
</Grid>
</Button.Content>
</Button>
</StackPanel>