void vm_SearchProductNotice(object sender, SimpleMvvmToolkit.NotificationEventArgs <List <Core.Model.Product>, Core.Model.Product> e)
        {
            bool selected = false;
            var  vm       = new QuickSearchProductViewModel(e.Data);

            var win = new SelectProductWindow();

            win.Owner       = Application.Current.MainWindow;
            win.DataContext = vm;

            vm.CloseNotice += (ss, ee) =>
            {
                if (vm.SelectedProduct != null)
                {
                    selected = true;
                    e.Completed(vm.SelectedProduct);
                }

                win.Close();
            };

            win.txtSearch.Focus();
            win.ShowDialog();

            if (!selected)
            {
                e.Completed(null);
            }
        }
示例#2
0
        void vm_SearchProductNotice(object sender, SimpleMvvmToolkit.NotificationEventArgs<List<Core.Model.Product>, Core.Model.Product> e)
        {
            bool selected = false;
            var vm = new QuickSearchProductViewModel(e.Data);

            var win = new SelectProductWindow();
            win.Owner = Application.Current.MainWindow;
            win.DataContext = vm;

            vm.CloseNotice += (ss, ee) =>
            {
                if (vm.SelectedProduct != null)
                {
                    selected = true;
                    e.Completed(vm.SelectedProduct);
                }

                win.Close();
            };

            win.txtSearch.Focus();
            win.ShowDialog();

            if (!selected)
                e.Completed(null);
        }