DIYGrid - don't invoke SelectionChanged callback unless it is actually coming from the DIYGrid (i.e., not some random child control)

This commit is contained in:
John Colvin committed 2019-04-22 15:56:23 -05:00
1 parent 64164db22e
commit 4ef8aaa689
1 file changed
+4 -1
@@ -862,7 +862,10 @@ namespace mbts.ui.controls {
if (selection_handler != null && owner._row_presenter is ListBox rp) {
rp.SelectionChanged += on_selection_changed;
_hooks.Add(Disposable.Create(() => rp.SelectionChanged -= on_selection_changed));
void on_selection_changed(object sender, SelectionChangedEventArgs e) => selection_handler.row_selection_changed(e);
void on_selection_changed(object sender, SelectionChangedEventArgs e) {
if (e.OriginalSource == rp)
selection_handler.row_selection_changed(e);
}
}
if (sorting_handler != null) {
owner.Sorting += sorting_handler.on_sorting;