Handling selection and deselection of objects in a user interface?

Hook up the mousedown event on each AudioObject (or just handle it entirely at the arrangement level by hittesting the click location) to the same handler in the arrangement. Then you can just set the selection visuals off for every AudioObject and then turn it on for the one sent into the handler. Doing it like this also makes it easier for you to maintain stuff like SelectedAudio property or a SelectionChanged event off of the arrangement control for use up the tree.

One way to maintain some degree of loose coupling would be to implement the selection notification through an event. As you say, the AudioObject controls could accept an Arrangement control in their constructors (or better yet, an IArrangement interface, so you could have multiple implementations for slightly better decoupling), and the IArrangement interface could have a RaiseItemSelected() method, which in turn raised the ItemSelected event. All AudioObject controls would know to listen to that event, and would deselect themselves if they're not the object being selected.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions