public EditorWindow() { InitializeComponent(); var tableControllerViewModel = new TableControllerViewModel(); var viewModel = new EditorWindowViewModel(tableControllerViewModel); DataContext = viewModel; viewModel.PropertyChanged += (s, e) => { var x = s as EditorWindowViewModel; if (x == null) { return; } if (e.PropertyName == "Project") { tableControllerViewModel.Project = viewModel.Project; } }; TablesController.DataContext = tableControllerViewModel; }
public EditorWindowViewModel(TableControllerViewModel tableControllerViewModel) { _tableController = tableControllerViewModel; _tableController.UpdateViews = UpdateAll; PropertyChanged += OnPropertyChanged; }