Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.ComponentModel;
- using System.Runtime.CompilerServices;
- namespace NonTrivialDataBindingDemoVS
- {
- class TitleViewModel : INotifyPropertyChanged
- {
- public event PropertyChangedEventHandler PropertyChanged;
- String title;
- public string Title
- {
- set
- {
- if (!value.Equals(title, StringComparison.Ordinal))
- {
- title = value;
- OnPropertyChanged("Title");
- }
- }
- get
- {
- return title;
- }
- }
- void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- var handler = PropertyChanged;
- if (handler != null)
- {
- handler(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment