public T ChooseOption <T>(string title, AsyncLazy <T[]> options, Predicate <T> selectedOptions) where T : class { var dlg = new ChooseOptionsWindow(this); dlg.SetSingleSelection(options, selectedOptions); dlg.Title = title; if (dlg.ShowDialog() == true) { return(dlg.SelectedOptions.Length > 0 ? (T)dlg.SelectedOptions[0] : null); } return(null); }
public T[] ChooseOptions <T>(string title, AsyncLazy <T[]> options, Predicate <T> selectedOptions) where T : class { var dlg = new ChooseOptionsWindow(this); dlg.SetMultipleSelection(options, selectedOptions); dlg.Title = title; if (dlg.ShowDialog() == true) { return(dlg.SelectedOptions.Cast <T>().ToArray()); } return(null); }