private void addinsButton_Click(object sender, RoutedEventArgs e) { SerializableSource serializableSource = (sender as FrameworkElement).DataContext as SerializableSource; if (serializableSource != null) { MigrationSource migrationSource = serializableSource.Model; AddinsDialogViewModel addinsDialogVM = new AddinsDialogViewModel(migrationSource); AddinsDialog dialog = new AddinsDialog(addinsDialogVM); dialog.Owner = Application.Current.MainWindow; dialog.ShowDialog(); } }
public AddinsDialog(AddinsDialogViewModel dialogVM) { InitializeComponent(); this.DataContext = dialogVM; AddinsDialogVM = dialogVM; }