public FGfcuView(FGfcuViewModel _viewModel) { InitializeComponent(); DataContext = _viewModel; viewModel = _viewModel; }
private void FGNavigationItemView_CloseViewRequested(object sender, EventArgs e) { FGahuViewModel ahuViewModel = container.Resolve <FGahuViewModel>(); FGfcuViewModel fcuViewModel = container.Resolve <FGfcuViewModel>(); applicationCommands.ImportFGCommand.UnregisterCommand(ahuViewModel.ImportFGCommand); applicationCommands.ExportFGCommand.UnregisterCommand(ahuViewModel.ExportFGCommand); applicationCommands.PrintLblCommand.UnregisterCommand(ahuViewModel.PrintLblCommand); applicationCommands.OKCommand.UnregisterCommand(ahuViewModel.OKCommand); applicationCommands.XOKCommand.UnregisterCommand(ahuViewModel.XOKCommand); applicationCommands.ImportFGCommand.UnregisterCommand(fcuViewModel.ImportFGCommand); applicationCommands.ExportFGCommand.UnregisterCommand(fcuViewModel.ExportFGCommand); applicationCommands.PrintLblCommand.UnregisterCommand(fcuViewModel.PrintLblCommand); applicationCommands.OKCommand.UnregisterCommand(fcuViewModel.OKCommand); applicationCommands.XOKCommand.UnregisterCommand(fcuViewModel.XOKCommand); }
private void InitTabRegion(long id) { IRegion tabRegion = regionManager.Regions[RegionNames.TabRegionFG]; if (tabRegion == null) { return; } FGahuView ahuView = tabRegion.GetView("FGahuView") as FGahuView; FGfcuView fcuView = tabRegion.GetView("FGfcuView") as FGfcuView; if (ahuView == null && fcuView == null) { ahuView = this.container.Resolve <FGahuView>(); fcuView = this.container.Resolve <FGfcuView>(); tabRegion.Add(ahuView, "FGahuView"); tabRegion.Add(fcuView, "FGfcuView"); } //tabRegion.Activate(ahuView); #region Generic Composite Buttons FGahuViewModel ahuViewModel = ahuView.DataContext as FGahuViewModel; FGfcuViewModel fcuViewModel = fcuView.DataContext as FGfcuViewModel; var navView = this.container.Resolve <FGNavigationItemView>(); navView.CloseViewRequested += delegate { _applicationCommands.ImportFGCommand.UnregisterCommand(ahuViewModel.ImportFGCommand); _applicationCommands.ExportFGCommand.UnregisterCommand(ahuViewModel.ExportFGCommand); _applicationCommands.PrintLblCommand.UnregisterCommand(ahuViewModel.PrintLblCommand); _applicationCommands.DeleteFGCommand.UnregisterCommand(ahuViewModel.DeleteFGCommand); _applicationCommands.OKCommand.UnregisterCommand(ahuViewModel.OKCommand); _applicationCommands.XOKCommand.UnregisterCommand(ahuViewModel.XOKCommand); _applicationCommands.ImportFGCommand.UnregisterCommand(fcuViewModel.ImportFGCommand); _applicationCommands.ExportFGCommand.UnregisterCommand(fcuViewModel.ExportFGCommand); _applicationCommands.PrintLblCommand.UnregisterCommand(fcuViewModel.PrintLblCommand); _applicationCommands.DeleteFGCommand.UnregisterCommand(fcuViewModel.DeleteFGCommand); _applicationCommands.OKCommand.UnregisterCommand(fcuViewModel.OKCommand); _applicationCommands.XOKCommand.UnregisterCommand(fcuViewModel.XOKCommand); }; _applicationCommands.ImportFGCommand.RegisterCommand(ahuViewModel.ImportFGCommand); _applicationCommands.ExportFGCommand.RegisterCommand(ahuViewModel.ExportFGCommand); _applicationCommands.PrintLblCommand.RegisterCommand(ahuViewModel.PrintLblCommand); _applicationCommands.DeleteFGCommand.RegisterCommand(ahuViewModel.DeleteFGCommand); _applicationCommands.OKCommand.RegisterCommand(ahuViewModel.OKCommand); _applicationCommands.XOKCommand.RegisterCommand(ahuViewModel.XOKCommand); _applicationCommands.ImportFGCommand.RegisterCommand(fcuViewModel.ImportFGCommand); _applicationCommands.ExportFGCommand.RegisterCommand(fcuViewModel.ExportFGCommand); _applicationCommands.PrintLblCommand.RegisterCommand(fcuViewModel.PrintLblCommand); _applicationCommands.DeleteFGCommand.RegisterCommand(fcuViewModel.DeleteFGCommand); _applicationCommands.OKCommand.RegisterCommand(fcuViewModel.OKCommand); _applicationCommands.XOKCommand.RegisterCommand(fcuViewModel.XOKCommand); #endregion Generic Composite Buttons }