コード例 #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);
 }