Is it possible to implement mouse click and drag selection box in WPF. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evalua
This project created a custom MultiSelector
which supports several selection methods including a rectangular "lasso" style:
Developing a MultiSelector by Teofil Cobzaru
It is far too long to reproduce here. The key elements of the design, IIRC, were to create a custom ItemContainer
which knows how to interact with its MultiSelector
parent. This is analagous to ListBoxItem
/ ListBox
.
This is probably not the simplest possible approach, however if you are already using some type of ItemsControl
to host the items which may need to be selected, it could fit into that design pretty easily.