Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }