void expediente_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "IsClick" && (sender as ExpedienteModel).IsClick ) { //abrir docto DlgUpload dlg = new DlgUpload(); _TrancingAsuntoViewModel = ConvertDataContext(this.DataContext); if (_TrancingAsuntoViewModel != null) { _TrancingAsuntoViewModel.SelectedExpedienteDocumento = (sender as ExpedienteModel); _TrancingAsuntoViewModel.SetOpenDoc(); dlg.DataContext = _TrancingAsuntoViewModel; dlg.Owner = Application.Current.Windows[0]; _TrancingAsuntoViewModel.start(); dlg.ShowDialog(); } _TrancingAsuntoTurnoViewModel = ConvertDataContext2(this.DataContext); if (_TrancingAsuntoTurnoViewModel != null) { _TrancingAsuntoTurnoViewModel.SelectedExpedienteDocumento = (sender as ExpedienteModel); _TrancingAsuntoTurnoViewModel.SetOpenDoc(); dlg.DataContext = _TrancingAsuntoTurnoViewModel; dlg.Owner = Application.Current.Windows[0]; _TrancingAsuntoTurnoViewModel.start(); dlg.ShowDialog(); } _TrancingAsuntoTurnoReadViewModel = ConvertDataContext3(this.DataContext); if (_TrancingAsuntoTurnoReadViewModel != null) { _TrancingAsuntoTurnoReadViewModel.SelectedExpedienteDocumento = (sender as ExpedienteModel); _TrancingAsuntoTurnoReadViewModel.SetOpenDoc(); dlg.DataContext = _TrancingAsuntoTurnoReadViewModel; dlg.Owner = Application.Current.Windows[0]; _TrancingAsuntoTurnoReadViewModel.start(); dlg.ShowDialog(); } (sender as ExpedienteModel).IsClick = false; } }
private void cbProceso_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender != null) { if (cbProceso.SelectedItem != null) { if (!CargaItemsViewModel.IsRunning) { DlgUpload ds = new DlgUpload(); CargaItemsViewModel viewModel = (this.DataContext as ObjectDataProvider).Data as CargaItemsViewModel; if (viewModel != null) { viewModel.SetCargaItemsViewModel(); ds.DataContext = viewModel; ds.Owner = Application.Current.Windows[0]; viewModel.start(); ds.ShowDialog(); } } } } }
private void treeView1_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { if (Application.Current.Windows[0] != null) { DlgUpload ds = new DlgUpload(); ds.Owner = Application.Current.Windows[0]; try { CargaItemsViewModel viewModel = (ds.Owner.DataContext as MainWindowViewModel).CurrentPageViewModel as CargaItemsViewModel; if (viewModel != null) { viewModel.SetCargaItemsMenuViewModel(); ds.DataContext = viewModel; viewModel.start(); ds.ShowDialog(); } } catch (Exception ex) { } } }