private void Open_Click(object sender, RoutedEventArgs e) { try { if (Trancport == null) { Trancport = new Trancport(); } TrancportInfoViewModel viewModel = new TrancportInfoViewModel(Trancport, this); TrancportInfoView view = new TrancportInfoView(viewModel); view.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Не удалось открыть информацию о ТС"); } }
public TrancportInfoView(TrancportInfoViewModel viewModel) { InitializeComponent(); DataContext = viewModel; }