易简.道(ething)

爱在进行时
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

 

 

 

 

 

namespace RestExample.Model

{

#if SILVERLIGHT

using System.ComponentModel;

public class Customer : INotifyPropertyChanged

#else

public class Customer

#endif

{

private int _id;

public int ID

{

get { return _id; }

set

{

_id = value;

#if SILVERLIGHT

NotifyPropertyChanged("ID");

#endif

}

}

 

private string _lastName;

public string LastName

{

get { return _lastName; }

set

{

_lastName = value;

#if SILVERLIGHT

NotifyPropertyChanged("LastName");

#endif

}

}

 

private string _firstName;

public string FirstName

{

get { return _firstName; }

set

{

_firstName = value;

#if SILVERLIGHT

NotifyPropertyChanged("FirstName");

#endif

}

}

 

private decimal _balance;

public decimal Balance

{

get { return _balance; }

set

{

_balance = value;

#if SILVERLIGHT

NotifyPropertyChanged("Balance");

#endif

}

}

 

#if SILVERLIGHT

public event PropertyChangedEventHandler PropertyChanged;

protected void NotifyPropertyChanged(string propertyName)

{

if (PropertyChanged != null)

PropertyChanged(this,

new PropertyChangedEventArgs(propertyName));

}

#endif

}

}