Created
January 3, 2012 15:51
-
-
Save JoanComasFdz/1555446 to your computer and use it in GitHub Desktop.
Basic VieModel for BussingessObject class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BussinessObjectViewModel : System.ComponentModel.INotifyPropertyChanged | |
{ | |
#region Implementation of INotifyPropertyChanged | |
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; | |
#endregion | |
private BussinessObject _bussinessObject; | |
public int Id | |
{ | |
get { return _bussinessObject.Id; } | |
set | |
{ | |
_bussinessObject.Id = value; | |
OnPropertyChanged("Id"); | |
} | |
} | |
public string Name | |
{ | |
get { return _bussinessObject.Name; } | |
set | |
{ | |
_bussinessObject.Name = value; | |
OnPropertyChanged("Name"); | |
} | |
} | |
public BussinessObjectViewModel(BussinessObject bussinessObject) | |
{ | |
_bussinessObject = bussinessObject; | |
} | |
private void OnPropertyChanged(string propertyName) | |
{ | |
if (PropertyChanged != null) | |
PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment