Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 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);
        }