Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the size of a SymbolIcon in XAML?

Tags:

I have a button that I want to use to launch video playback, so it should look like a "Play" button. The button will be fairly large on screen. This is what I have so far:

<Button Style="{StaticResource PlayButton}">     <SymbolIcon Symbol="Play"/>                                 </Button> 

The PlayButton resource defines a MinHeight and MinWidth of 200px. The problem with this is that the play icon is very small, in the order of 16px or so. How can I make it larger? I tried setting FontSize="200" in the Button declaration, but it makes no difference.

like image 382
Mike Avatar asked Aug 05 '14 23:08

Mike


2 Answers

Not sure if this is the best way to do it, but it worked for me and might work for you:

<Button Style="{StaticResource PlayButton}">     <Viewbox MaxHeight="200" MaxWidth="200">         <SymbolIcon Symbol="Play"/>                                     </Viewbox> </Button> 
like image 104
Mike Avatar answered Oct 16 '22 09:10

Mike


You could use a TextBlock with FontFamily="Segoe UI Symbol" Text="&#57602;" and then setting FontSize works. If you look at the Symbol values - you can see the 57602 is the value of the Play symbol enum which corresponds to the character code in "Segoe UI Symbol". More typically these values are written with their hex values as in Text="&#xE102;", but the decimal is easier to find if you look at that enum's documentation.

like image 20
Filip Skakun Avatar answered Oct 16 '22 08:10

Filip Skakun