public void AddMean(Meanings mean) { if (mean != null) { var meaningViewModel = new MeaningViewModel(mean, this.Font, _supposedWidth); this.Items.Add(meaningViewModel); this.SetItemChecked(this.Items.Count - 1, true); this.SetSelected(this.Items.Count - 1, true); } }
private void InitMeans() { this.Items.Clear(); if (this.allMeanings != null && this.allMeanings.Count > 0) { foreach (Meanings meaningItem in this.allMeanings) { var meaningViewModel = new MeaningViewModel(meaningItem, this.Font, _supposedWidth); this.Items.Add(meaningViewModel); } this.SetSelected(0, true); } }