示例#1
0
        protected override FrameworkElement CreateControl(object initParams)
        {
            var tree = new WindowsShellTreeView();

            tree.SetupDataContextChanged(e => OnDataContextChanged(tree, e));
            return(tree);
        }
示例#2
0
        private void OnDataContextChanged(WindowsShellTreeView tree, object dataContext)
        {
            var vm = (WindowsShellTreeViewModel)dataContext;

            if (vm != null)
            {
                vm.PropertyChanged += HandleViewModelPropertyChanged;
            }
        }