适用于WinRT的AppBarButtonSyle

Tho*_*sen 6 c# xaml windows-runtime

是否有一个列表,我可以在其中查找AppBarButtons的值?

如果我在查看StandardLayout.xaml,我发现了一些例子,比如说

<Style x:Key="ZoomOutButtonStyle" TargetType="Button" BasedOn="{StaticResource AppBarButtonStyle}">
  <Setter Property="AutomationProperties.AutomationId" Value="ZoomOutButtonStyle"/>
  <Setter Property="AutomationProperties.Name" Value="Zoom Out"/>
  <Setter Property="Content" Value="&#xE1A4;"/>
</Style>
Run Code Online (Sandbox Code Playgroud)

是否有像这样的值的列表

&#xE1A4;
Run Code Online (Sandbox Code Playgroud)

谢谢.

小智 7

运行Character Map程序并从字体列表中选择Segoe UI Symbol: -

字符映射剪辑

你要找的那个,在你的例子中,只是忽略开头的&#x.您可以使用任何字体查看器程序或在Syncfusion Metro Studio FREE免费查看Syncfusion Metro Studio的免费版本 (2 intro min vid)以获得更高级的图标操作.

只是玩得开心...


小智 6

请参阅Segoe UI Symbol中的完整图标列表(存在于StandardLayout.xaml中)及其unicode值,网址http://kishore1021.files.wordpress.com/2012/09/appbar.png.在每个图标下,您可以看到名称和unicode值.

要使用其中一种样式,您只需在代码中使用以下Xaml即可.

<Button Style="{StaticResource RemoveAppBarButtonStyle}"/>
Run Code Online (Sandbox Code Playgroud)

将StaticResource旁边的单词替换为您想要的按钮.

要自定义显示的按钮,您可以从基本样式派生自己的样式,并使用setter设置具有所需值的属性,如下面的代码所示.在这里,我显示一个地球图标,图标下方的文字是"获取位置".

<Style x:Key="GlobeAppBarButtonStyle" TargetType="Button" 
BasedOn="{StaticResource AppBarButtonStyle}">
    <Setter Property="Content" Value="&#x128;" />
    <Setter Property="AutomationProperties.Name" Value="Get Location>
</Style>
Run Code Online (Sandbox Code Playgroud)