I need to have a button style that will present 3 different texts of the binded stings. Now, I can easily pass one text string to Content Presenter where Content=”{TemplateBinding Content}”. I need to be able to pass 3 strings in a similar way to 3 either texblock inside button style or use multiple Content presenters. I am wondering how I can do this. Any ideas are highly appreciated?
Share
You can use a custom DataTemplate:
You can swap out or change the layout by altering the StackPanel.
If it needs to be a Style, you could use:
And then you’d need to define a custom class to pass the three values like so:
And then use it like so:
Where local refers to the namespace of MyClass.