问题
I'm using standard styles for my Metro
app. Most of these styles contains an Image
and I wanna use Segoe UI Symbol
s as these images.
how can I achieve this?
回答1:
You can insert the "character" in any text content that is using the Segoe UI Symbol as the font. If I wanted a Favorite's Star in a TextBlock, it would look like this...
<TextBox x:Name="textBox" HorizontalAlignment="Left" Margin="372,375,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"/>
If I wanted to make a button that had the same "character" in it, I would do this...
<Button x:Name="button" Content="" HorizontalAlignment="Left" Margin="372,181,0,0" VerticalAlignment="Top" Click="button_Click" FontFamily="Segoe UI Symbol" FontSize="24" Height="79" Width="128"/>
If I wanted the button to take on the circle AppBar button style, I would add the Style resource like this...
<Button x:Name="button" Content="" HorizontalAlignment="Left" Margin="372,181,0,0" VerticalAlignment="Top" Click="button_Click" FontFamily="Segoe UI Symbol" FontSize="24" Style="{StaticResource AppBarButtonStyle}" Height="79" Width="128"/>
Same type of approach if you are using HTML. Just make sure you styles are correct...
<span class="pagetitle"></span>
来源:https://stackoverflow.com/questions/12037888/create-image-from-character