private void AddSyncJobHistory(SyncJobViewModel syncJobViewModel) { SyncJobPanelViewModel syncJobPanel = new SyncJobPanelViewModel(this.relationship) { SyncJobViewModel = syncJobViewModel }; int index = this.FindIndex(syncJobPanel); this.Children.Insert(index, new SyncJobNodeViewModel(this, syncJobPanel)); this.RaisePropertyChanged(nameof(this.Children)); }
public SyncJobNodeViewModel(NavigationNodeViewModel parent, SyncJobPanelViewModel syncJobPanel) : base(parent, syncJobPanel) { this.syncJobPanel = syncJobPanel; if (syncJobPanel.SyncJobViewModel != null) { this.Name = syncJobPanel.SyncJobViewModel.StartTime.ToString("g"); } this.SetIconImage(); }
private int FindIndex(SyncJobPanelViewModel syncJobPanel) { int i = 0; for (; i < this.Children.Count; i++) { SyncJobNodeViewModel nodeViewModel = this.Children[i] as SyncJobNodeViewModel; if (syncJobPanel.SyncJobViewModel.StartTime > ((SyncJobPanelViewModel)nodeViewModel.Item).SyncJobViewModel.StartTime) { return(i); } } return(i); }