Skip to content

How to add the specific icon to the button content that we have added in resources in material design in xaml toolkit? #3112

Closed Answered by nicolaihenriksen
VahidEra asked this question in Q&A
Discussion options

You must be logged in to vote

@VahidEra A Button in WPF is a ContentControl 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 the PackIconExtension which is a MarkupExtension which returns a PackIcon 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:

<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" y…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VahidEra
Comment options

Answer selected by VahidEra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants