one button with wrapped list view
my searched result are:
1.worst approach: put add button on the wrapped list view.
2.bad approach: set two data template for list view.
3.?
thanks
one button with wrapped list view
my searched result are:
1.worst approach: put add button on the wrapped list view.
2.bad approach: set two data template for list view.
3.?
thanks
I've had something similar a while back. In the end I decided to add a fake data item where I needed the button.
Say I had a list of
MyDataItem
, I created a derived classMyFakeDataItem
and added that at the end of the list, after I finished populating it. In the WPF I created two data templates, one for each class, and a selected to decide.I think it turned out quite elegant, since it allowed me to easily override any real functionality I had on
MyDataItem
, and add a command on the fake one to suit my needs.Hope that helps.