I’m creating buttons dynamically that have images as their background, The problem is the default WPF button animation on mouse over deform my button and hide the image.
Is there any way I can make my own button style for these buttons without creating a custom button class, and using something like myButtton.property = something;
in C# code not XAML because I’m creating the button dynamically.
YOu can do this by creating a template for button in resources…
Here is a sample…
XAML Code…
in code behind:
if you are adding buttons from view model you can get the button template from app resources (by putting the resource in app.xaml file)