selectionchanging

How to program "Selection Changing" event in ListBox in WPF?

I have a listbox and I want to prevent changing of ListBox's selection if user has not finished certain tasks, this is the best explanation i can provide at this time, in WinForms there used to be selection changing and it has cancellable event arguement, where in we could trap and cancel even of changing the selection. I thought I will...

DataGrid is not obedient to SelectedIndex property set

I need to make the DataGrid, so if I am in edit mode, and the current row is not valid, the user should not be able to select a different row. In fact, I think that the DataGrid is supposed to avoid selection of another row once the CollectionChangingEventArgs of the CollectionView is flagged for cancellation, the DataGrid should stick ...