Since I could not find a direct duplicate (to which I could swear that this is the type of question that was asked before), I assume that I will put a legitimate answer.
The button template is ContentPresenter on ContentPresenter , which allows you to transfer any CLR object. However, the caveat is that only one can be transmitted. HOWEVER, if this object is a panel capable of containing children, then it will go all through the content.
So, in this case, if we did it like this:
<Button> <Image/> <TextBlock/> </Button>
Then he will fail and complain only about one object, resolved at a time.
Unless you provide a parent panel for storing these children, it respects all this as content and will provide the desired result as an example:
<Button> <StackPanel> <Image/> <TextBlock/> </StackPanel> </Button>
So, since the StackPanel is a CLR object that can accommodate children, you're good to go. Hope this helps, cheers!
Chris W.
source share