Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. class QuestionsVM
  2.     {
  3.         public ObservableCollection<QuestionVM> Questions { get; set; } = new ObservableCollection<QuestionVM>();
  4.  
  5.         public void AddQ()
  6.             => Questions.Add(new QuestionVM(this));
  7.     }
  8.    
  9.     class QuestionVM
  10.     {
  11.         public QuestionVM(QuestionsVM obj)
  12.         {
  13.             AddNewItem = new RelayCommand<object>(o => obj.AddQ());
  14.         }
  15.  
  16.         public ICommand AddNewItem { get; set; }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement