Windows8程序开发小技巧---在代码中使用Segoe UI Symbol图标字体及常用图标列表
在windows商店应用程序开发中经常会Segoe UI Symbol图标符号,在xaml中使用很简单,如下边的代码
<StackPanel Grid.Column="2" Grid.Row="0" Grid.RowSpan="2" Margin="10,5,5,5" Orientation="Horizontal" > <Button Content="" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="Segoe UI Symbol" FontSize="24"> </Button> <Button Content="" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="Segoe UI Symbol" FontSize="24"/> <Button x:Name="btnAutoPlay" Content="" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="Segoe UI Symbol" FontSize="24" Tapped="btnAutoPlay_Tapped"/> <Button Content="" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontFamily="Segoe UI Symbol" FontSize="24"/> </StackPanel>
那么在.cs代码中应该如何来使用呢,很简单,见如下代码
this.btnAutoPlay.Content = char.ConvertFromUtf32(0xE102);
常用图标列表: