I want to make a user control that shows an image and can invoke a command when clicked. Later I want to bind a list of these controls to a list of products.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
Try this very straight forward approach
I don't know about you guys but
PreviewMouseDown
andTouchUp
worked completely fine along with my binding:I am using VS 2015
Well, after a little more fiddling, a simple button does the job. Here it is:
There are several ways to do this, but one simple solution would be to use a button (maybe style away the border and background), and use the image as the content of the button.
You can later use a ListBox or similar, and override the DataTemplate to use the button and an image for each product.