예제 #1
0
        public TableTreeViewItemViewModel(BrowserViewModel browser, DiffDataTable diffTable)
            : base(browser)
        {
            this.diffTable = diffTable;
            this.diffTable.PropertyChanged             += DiffType_PropertyChanged;
            this.diffTable.SourceItem1.PropertyChanged += SourceItem1_PropertyChanged;
            this.diffTable.SourceItem2.PropertyChanged += SourceItem2_PropertyChanged;
            this.header1     = diffTable.Header1;
            this.header2     = diffTable.Header2;
            this.viewCommand = new DelegateCommand(this.View);
            this.isActivated = diffTable.DiffState != DiffState.Unchanged;
            this.Target      = diffTable;

            foreach (var item in diffTable.Childs)
            {
                var viewModel = new TableTreeViewItemViewModel(browser, item);
                viewModel.PropertyChanged += ChildViewModel_PropertyChanged;
                this.Items.Add(viewModel);
                if (this.isActivated == false && viewModel.DiffState != DiffState.Unchanged)
                {
                    this.isActivated = true;
                }
            }
            this.Dispatcher.InvokeAsync(() =>
            {
                if (this.DiffState != DiffState.Unchanged && this.Parent != null)
                {
                    this.Parent.IsExpanded = true;
                }
            });
        }
        public TemplateTreeViewItemViewModel(BrowserViewModel browser, DiffTemplate diffTemplate)
            : base(browser)
        {
            this.diffTemplate = diffTemplate;
            this.diffTemplate.PropertyChanged             += DiffTemplate_PropertyChanged;
            this.diffTemplate.SourceItem1.PropertyChanged += Template1_PropertyChanged;
            this.diffTemplate.SourceItem2.PropertyChanged += Template2_PropertyChanged;
            this.header1     = diffTemplate.Header1;
            this.header2     = diffTemplate.Header2;
            this.viewCommand = new DelegateCommand(this.View);
            this.isActivated = diffTemplate.DiffState != DiffState.Unchanged;
            this.Target      = diffTemplate;

            foreach (var item in this.diffTemplate.DiffTable.Childs)
            {
                this.Items.Add(new TemplateTreeViewItemViewModel(browser, item.Template));
            }
            this.Dispatcher.InvokeAsync(() =>
            {
                if (this.DiffState != DiffState.Unchanged && this.Parent != null)
                {
                    this.Parent.IsExpanded = true;
                }
            });
        }
예제 #3
0
 public TypeTreeViewItemViewModel(BrowserViewModel browser, DiffDataType diffType)
     : base(browser)
 {
     this.diffType = diffType;
     this.diffType.PropertyChanged             += DiffType_PropertyChanged;
     this.diffType.SourceItem1.PropertyChanged += DataType1_PropertyChanged;
     this.diffType.SourceItem2.PropertyChanged += DataType2_PropertyChanged;
     this.header1     = diffType.Header1;
     this.header2     = diffType.Header2;
     this.viewCommand = new DelegateCommand(this.View);
     this.isActivated = diffType.DiffState != DiffState.Unchanged;
     this.Target      = diffType;
 }
 public DifferenceTreeViewItemViewModel(BrowserViewModel browser)
 {
     this.browser = browser;
 }