public DetailsAttaqueView(AttaqueInfoVM aVM) { InitializeComponent(); this.DataContext = aVM; aVM.DemandeFermeture += Fermeture; }
public DetailsAttaqueView() { InitializeComponent(); AttaqueInfoVM attaqueInfoVM = new AttaqueInfoVM(); this.DataContext = attaqueInfoVM; attaqueInfoVM.DemandeFermeture += Fermeture; }
private void TestDetailsDmg_Click(object sender, RoutedEventArgs e) { DetailsAttaqueView detailsAttaqueView = new DetailsAttaqueView(); if (detailsAttaqueView.ShowDialog() == true) { MessageBox.Show("VRAI!!"); AttaqueInfoVM viewModel = (AttaqueInfoVM)detailsAttaqueView.DataContext; } else { MessageBox.Show("FAUX!!"); } }