protected override FrameworkElement CreateControl(object initParams) { var tree = new WindowsShellTreeView(); tree.SetupDataContextChanged(e => OnDataContextChanged(tree, e)); return(tree); }
private void OnDataContextChanged(WindowsShellTreeView tree, object dataContext) { var vm = (WindowsShellTreeViewModel)dataContext; if (vm != null) { vm.PropertyChanged += HandleViewModelPropertyChanged; } }