Beispiel #1
0
        public TemplateTreeViewItemViewModel(BrowserViewModel browser, DocumentServiceViewModel documentService, DiffTemplate diffTemplate)
            : base(browser)
        {
            this.documentService                     = documentService;
            this.Source                              = diffTemplate;
            this.Source.PropertyChanged             += DiffTemplate_PropertyChanged;
            this.Source.SourceItem1.PropertyChanged += Template1_PropertyChanged;
            this.Source.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.Source.DiffTable.Childs)
            {
                this.Items.Add(new TemplateTreeViewItemViewModel(browser, documentService, diffTemplate: item.Template));
            }
            this.Dispatcher.InvokeAsync(() =>
            {
                if (this.DiffState != DiffState.Unchanged && this.Parent != null)
                {
                    this.Parent.IsExpanded = true;
                }
            });
        }
Beispiel #2
0
        public TableTreeViewItemViewModel(BrowserViewModel browser, DocumentServiceViewModel documentService, DiffDataTable diffTable)
            : base(browser)
        {
            this.documentService                     = documentService;
            this.Source                              = diffTable;
            this.Source.PropertyChanged             += DiffType_PropertyChanged;
            this.Source.SourceItem1.PropertyChanged += SourceItem1_PropertyChanged;
            this.Source.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, documentService, diffTable: 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;
                }
            });
        }
Beispiel #3
0
 public BrowserViewModel(Authenticator authenticator, ICremaHost cremaHost, ICremaAppHost cremaAppHost, PropertyService propertyService, BrowserService browserService, DocumentServiceViewModel documentService)
 {
     this.authenticator   = authenticator;
     this.cremaHost       = cremaHost;
     this.cremaAppHost    = cremaAppHost;
     this.propertyService = propertyService;
     this.browserService  = browserService;
     this.documentService = documentService;
 }
 public TypeTreeViewItemViewModel(BrowserViewModel browser, DocumentServiceViewModel documentService, DiffDataType diffType)
     : base(browser)
 {
     this.documentService                     = documentService;
     this.Source                              = diffType;
     this.Source.PropertyChanged             += DiffType_PropertyChanged;
     this.Source.SourceItem1.PropertyChanged += DataType1_PropertyChanged;
     this.Source.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 DifferencesServiceViewModel(ICremaAppHost cremaAppHost, IBrowserService browserService, DocumentServiceViewModel contentsService, IPropertyService propertyService)
 {
     this.cremaAppHost           = cremaAppHost;
     this.cremaAppHost.Opened   += CremaAppHost_Opened;
     this.cremaAppHost.Closed   += CremaAppHost_Closed;
     this.cremaAppHost.Loaded   += CremaAppHost_Loaded;
     this.cremaAppHost.Unloaded += CremaAppHost_Unloaded;
     this.DisplayName            = Resources.Title_Differences;
 }
Beispiel #6
0
 public DifferencesServiceViewModel(ICremaAppHost cremaAppHost, IBrowserService browserService, DocumentServiceViewModel documentService, IPropertyService propertyService, IAppConfiguration configs)
 {
     this.cremaAppHost           = cremaAppHost;
     this.cremaAppHost.Opened   += CremaAppHost_Opened;
     this.cremaAppHost.Closed   += CremaAppHost_Closed;
     this.cremaAppHost.Loaded   += CremaAppHost_Loaded;
     this.cremaAppHost.Unloaded += CremaAppHost_Unloaded;
     this.BrowserService         = browserService;
     this.DocumentService        = documentService;
     this.PropertyService        = propertyService;
     this.configs     = configs;
     this.DisplayName = Resources.Title_Differences;
 }