예제 #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);
 }