Guest User

Untitled

a guest
May 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public class ViewModel : INotifyPropertyChanged
  2. {
  3. private Model _model=new Model("BlaBlaBla");
  4. public string ModelName
  5. {
  6. get { return _model.ModelName; }
  7. set
  8. {
  9. _model.ModelName = value;
  10. OnPropertyChanged("ModelName");
  11. }
  12. }
  13. protected virtual void OnPropertyChanged(string propertyName)
  14. {
  15. var handler = PropertyChanged;
  16. if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
  17. }
  18. }
  19.  
  20. class Model
  21. {
  22. public string ModelName { get; set; }
  23.  
  24. public Model(string name){
  25. ModelName=name
  26. }
  27. }
  28.  
  29. private Model _model = new Model("BlaBlaBla");
  30.  
  31. public Model(string name)
  32. {
  33. ModelName=name
  34. }
Add Comment
Please, Sign In to add comment