How to add the specific icon to the button content that we have added in resources in material design in xaml toolkit? #3112
-
Hi guys
But i want this:
Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@VahidEra A When you add the below to the You don't need to specify the content in this manner, you can simply do something like this: <Button>
<StackPanel Orientation="Vertical">
<TextBlock Text="Hello" />
<TextBlock Text="World" />
</StackPanel>
</Button> This simply creates a button with 2 rows of text. So depending on what the type of "icon" you have in your resources is, you could follow the same approach. Probably something along the lines of: <Button>
<Image Source="...INSERRT RESOURCE PATH HERE..." />
</Button> You may want to explicitly define the |
Beta Was this translation helpful? Give feedback.
@VahidEra A
Button
in WPF is aContentControl
which mean you, as a the calling code, gets to choose what content you want to put inside of it.When you add the below to the
Content
property, it basically just invokes thePackIconExtension
which is aMarkupExtension
which returns aPackIcon
control with the requested icon kind.Content="{md:PackIcon Kind=CursorMove, Size=25}"
You don't need to specify the content in this manner, you can simply do something like this:
This simply creates a button with 2 rows of text.
So depending on what the type of "icon" y…