protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var w = new MainDataView(); var vm = new MainDataViewModel(); w.DataContext = vm; w.Show(); }
protected override void OnDataContextChanged(EventArgs e) { if (_model != null) { _model.View = null; } _model = DataContext as MainDataViewModel; if (_model != null) { _model.View = this; } base.OnDataContextChanged(e); }