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

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

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