Esempio n. 1
0
        public frmCoatingMaster(string formName, WPF.MDI.MdiChild me)
        {
            InitializeComponent();
            this._formName = formName;
            OperationMasterViewModel vm = new OperationMasterViewModel(_formName);

            this.DataContext = vm;
            me.Closing      += vm.CloseMethod;
            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => me.Close());
            }
        }
Esempio n. 2
0
        public frmToolsInfo(UserInformation userInformation, WPF.MDI.MdiChild mdiChild)
        {
            InitializeComponent();
            ToolInfoViewModel vm = new ToolInfoViewModel();

            this.DataContext  = vm;
            mdiChild.Closing += vm.CloseMethod;
            vm.PreviewImage   = imgPhoto;
            vm.DgToolInfo     = rpdDataGrid;

            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => mdiChild.Close());
            }
        }
Esempio n. 3
0
        static void MdiChild_KeyDown(object sender, KeyEventArgs e)
        {
            MdiChild mdiChild = (MdiChild)sender;

            switch (e.Key)
            {
            case Key.F4:
                if (e.KeyboardDevice.Modifiers == ModifierKeys.Alt)
                {
                    mdiChild.Close();
                    e.Handled = true;
                }
                break;
            }
        }
Esempio n. 4
0
        public frmOperationMain(string formName, WPF.MDI.MdiChild me)
        {
            InitializeComponent();
            this._formName = formName;


            //  FocusManager.SetFocusedElement(this, txt_operDesc);
            OperationMasterViewModel vm = new OperationMasterViewModel(_formName);

            this.DataContext = vm;
            me.Closing      += vm.CloseMethod;
            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(() => me.Close());
            }
        }