public LabelDefinitionViewModel(BindableLabel label) { this.label = label; this.Lower = label.Lower; this.Upper = label.Upper; this.Medium = label.Medium; this.LabelName = label.Name; this.DisplayName = "Define Label"; }
public void DownLabel(BindableLabel label) { var currentIndex = this.Labels.IndexOf(label); if (currentIndex < this.Labels.Count - 1) { var nextLabel = this.Labels[currentIndex + 1]; this.Labels[currentIndex] = nextLabel; this.Labels[currentIndex + 1] = label; label.Index = currentIndex + 1; nextLabel.Index = currentIndex; } }
public void UpLabel(BindableLabel label) { var currentIndex = this.Labels.IndexOf(label); if (currentIndex > 0) { var previousLabel = this.Labels[currentIndex - 1]; this.Labels[currentIndex] = previousLabel; this.Labels[currentIndex - 1] = label; this.NotifyOfPropertyChange(() => this.Labels); label.Index = currentIndex - 1; previousLabel.Index = currentIndex; } }