lundi 29 juin 2015

WPF ButtonStyle with PathGeometry as an icon

How I can add PathGeometry as an Icon to the style of the button/radbutton?

In resources I have for example:

 <PathGeometry x:Key="HomeIconData">F1 M 22,19L 24,19L 24,57L 22,57L 22,19 Z M 26,57L 26,19.0001L 53.9999,19.0001L 53.9999,57L 26,57 Z M 30,24L 30,27L 50,27L 50,24L 30,24 Z M 30,32L 30,35L 33,35L 33,32L 30,32 Z M 36,32L 36,35L 49,35L 49,32L 36,32 Z M 30,40L 30,43L 33,43L 33,40L 30,40 Z M 36,40L 36,43L 48,43L 48,40L 36,40 Z M 30,48L 30,51L 33,51L 33,48L 30,48 Z M 36,48L 36,51L 50,51L 50,48L 36,48 Z</PathGeometry>

With Path I add this to the style:

 <Grid Margin="0,30,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="36" Width="41">
  <Path HorizontalAlignment="Center" Data="{Binding Source={StaticResource path1}, Path=Data}" Fill="#FFFFFFFF" Height="27" Stretch="Fill" Width="28.167" VerticalAlignment="Bottom" />
  </Grid>

How can I do the same with PathGeometry? Thanks

Aucun commentaire:

Enregistrer un commentaire