As we discuss in an earlier post one of the drawbacks of the CollectionViewSource is that whenever the source collection items are modified the filter does not refresh automatically.
In order to solve this issue we can create our own CollectionViewSource and add it this capability. In fact it’s very straight forward. We’ll have to subscribe to the items’ propertyChanged event and then refresh the view!
With this new behaviour applied to any panel you will be able to drag the items of any child listbox and drop them where ever you want. In the example you will see that the items get drop into another listbox but this can be easily customized.
This behaviour exposes a single event you have to suscribe: onMouseReleased.
I made this behaviour just to enable double click events in Silverlight. It’s easy to work with this. Just remember to handle the click and double click event of the behaviour and avoid handling the control mouseButtonUp event, as it will make that the behaviour never handles its events.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.