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()); } }
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()); } }
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; } }
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()); } }