void OnAddSecondaryResult() { var vm = new ItemFinderViewModel(); vm.ItemSelected += (s, e) => SecondaryResults.Collection.Add(vm.SelectedObject); var w = new ItemFinderWindow(); w.DataContext = vm; vm.Canceled += (s, e) => w.Close(); w.ShowDialog(); }
public static Item GetItem() { Item item = null; var vm = new ItemFinderViewModel(); vm.ItemSelected += (s, e) => item = vm.SelectedObject.DomainObject; var w = new ItemFinderWindow(); w.DataContext = vm; vm.Canceled += (s, e) => w.Close(); w.ShowDialog(); return(item); }