private void viewModel_openPopupDialogRequest(object sender, EventArgs e) { if (e is SelezioneFotografoPopupRequestEventArgs) { SelezioneFotografoPopupRequestEventArgs popEventArgs = (SelezioneFotografoPopupRequestEventArgs)e; SelettoreFotografoPopup win = new SelettoreFotografoPopup(); viewModel.selettoreFotografoViewModelFaccia.deselezionareTutto(); // Questo è il viewmodel della finestra di popup SelettoreFotografoPopupViewModel sfpViewModel = new SelettoreFotografoPopupViewModel(); sfpViewModel.immagine = popEventArgs.fotoFaccia.imgProvino; win.DataContext = sfpViewModel; // Questo è il viewmodel del componente che deve selezionare un fotografo win.selettoreFotografoFaccia.DataContext = viewModel.selettoreFotografoViewModelFaccia; var esito = win.ShowDialog(); if (esito == true) { viewModel.associareFacciaFotografoCommand.Execute(null); } Console.WriteLine(esito); win.Close(); } }
private void openAssociaFacciaFotografoPopup() { // Se ho qualche ascoltatore, lo invoco SelezioneFotografoPopupRequestEventArgs args = new SelezioneFotografoPopupRequestEventArgs(getListaFotoTarget().Single()); RaisePopupDialogRequest(args); }