Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderEditBehavior"/> class.
        /// </summary>
        public OrderEditBehavior()
            : base((s, e) =>
        {
            GridViewModel vm         = (GridViewModel)(s as MenuItem).DataContext;
            ManipulatorView editView = new ManipulatorView(new ManipulatorViewModel(vm.SelectedOrder, true));
            editView.Owner           = Application.Current.MainWindow;

            if ((bool)editView.ShowDialog())
            {
                return((editView.DataContext as ManipulatorViewModel).OrdersInfo);
            }
            return(null);
        })
        {}
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderAddBehavior"/> class.
        /// </summary>
        public OrderAddBehavior()
            : base((s, e) =>
        {
            ManipulatorViewModel viewModel = new ManipulatorViewModel(new OrderInfo(), false);
            ManipulatorView addView        = new ManipulatorView(viewModel);
            addView.Owner = Application.Current.MainWindow;

            if ((bool)addView.ShowDialog())
            {
                return(viewModel.OrdersInfo);
            }
            return(null);
        })
        { }