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

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

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