C# XAML (WPF) add button to image -
i have code:
<button > <button.content> <image source="component/resources/homer.jpg" /> </button.content> </button>
this create image part of button want opposite thing, want have image , make button part od image
something like:
<image > <button> </button> </image>
is possible? if yes, how?
thanks you
this not directly possible.
the reason image class designed display image, not host controls, , not implement content or inherit contentcontrol way other hosting objects do.
while there no little reason can fathom not place image in button, there few options.
- while image not implement click event, can use preview mouse down similar effect.
- you can place both button , image in grid, causing them share same space
<grid > <button ... horizontalalignment="stretch" verticalalignment="stretch" /> <image ... /> </grid >
Comments
Post a Comment