Пример #1
0
        private void AddNewViewModel()
        {
            var next = new WordEditorViewModel();

            this.Words.Add(next);
            next.ContentChanged += this.NewWord_ContentChanged;
        }
Пример #2
0
 private void NewWord_ContentChanged(WordEditorViewModel sender)
 {
     if (sender.Status != WordEditorStatus.New)
     {
         sender.ContentChanged -= this.NewWord_ContentChanged;
         this.AddNewViewModel();
     }
 }
Пример #3
0
 public void SetMajor(WordEditorViewModel word)
 {
     Debug.Assert(word != this.MajorWord);
     if (string.IsNullOrWhiteSpace(word.Text) || word.Text.AsLines().Length > 1)
     {
         return;
     }
     if (this.MajorWord != null)
     {
         this.MajorWord.Status = WordEditorStatus.Value;
     }
     this.MajorWord        = word;
     this.MajorWord.Status = WordEditorStatus.Major;
 }
Пример #4
0
 public void Remove(WordEditorViewModel word)
 {
     Debug.Assert(word != this.MajorWord);
     this.Words.Remove(word);
 }