Windows: Add OriginHierarchyWindow
This commit is contained in:
Elwig
@ -183,6 +183,15 @@ namespace Elwig.Helpers {
|
||||
SelectComboBoxItem(cb, getId, getId(item));
|
||||
}
|
||||
|
||||
public static void SelectListBoxItem(ListBox lb, Func<object?, object?> getId, object? id) {
|
||||
lb.SelectedItem = GetItemFromSource(lb.ItemsSource, getId, id);
|
||||
lb.ScrollIntoView(lb.SelectedItem);
|
||||
}
|
||||
|
||||
public static void SelectListBoxItem(ListBox lb, object? item, Func<object?, object?> getId) {
|
||||
SelectListBoxItem(lb, getId, getId(item));
|
||||
}
|
||||
|
||||
public static IEnumerable<object?> GetItemsFromSource(IEnumerable source, Func<object?, object?> getId, IEnumerable<object?> ids) {
|
||||
if (source == null)
|
||||
return Array.Empty<object>();
|
||||
|
Reference in New Issue
Block a user