public InProcDesignerView(HostedAppModel appModel) { _appModel = appModel; InitializeComponent(); DataContext = _appModel; _appModel.PropertyChanged += ModelPropertyChanged; WindowHostControl.Child = _host = new WindowHost(true); HandleVisibility(); HandleWindow(); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (_appModel != null) { _appModel.PropertyChanged -= ModelPropertyChanged; } _appModel = DataContext as HostedAppModel; if (_appModel != null) { _appModel.PropertyChanged += ModelPropertyChanged; } }