Image in a button
Why is it so difficult to put an image into a control button in WPF using C#? in the forms application I just select an image using the image property from a resource file, and Bob's your uncle. why is it so B***** difficult in WPF??? I've googled it, and i get lots of code telling me to write fourteen hundred lines of code (maybe not that many,,) but I'm a busy developer, an I don't have the time to do that. please somebody, tell me there's an easier way..
Martin CookPosted Feb 10, 2010, 6:25 AM
If you are needing to update an image source dynamically based on conditions then you can achieve this using DataTemplates and DataTriggers therefore not requiring any code-behind.
Hope this points you in the right direction.
Cheers,
Martin
Gaurish KumarPosted Jan 22, 2010, 6:58 AM
This example creates Button controls with image on it.