ControlUtils: Fix ScrollIntoView()
This commit is contained in:
@ -183,10 +183,10 @@ namespace Elwig.Helpers {
|
|||||||
} else {
|
} else {
|
||||||
input.SelectedItem = GetItemFromSource(input.ItemsSource, (int)hash);
|
input.SelectedItem = GetItemFromSource(input.ItemsSource, (int)hash);
|
||||||
}
|
}
|
||||||
if (input is ListBox lb) {
|
if (input is ListBox lb && lb.SelectedItem is object lbItem) {
|
||||||
lb.ScrollIntoView(lb.SelectedItem);
|
lb.ScrollIntoView(lbItem);
|
||||||
} else if (input is DataGrid dg) {
|
} else if (input is DataGrid dg && dg.SelectedItem is object dgItem) {
|
||||||
dg.ScrollIntoView(dg.SelectedItem);
|
dg.ScrollIntoView(dgItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user