C# Class Spinnaker.Sample.WinForms.ViewModels.Customer

Represents a customer in the sample application. Since we intend to use each Customer in the view, we implement INotifyPropertyChanged so that our view can bind to Customer's properties. Even though we have lots of customers in our application, each of them is its own view model. In a real application, this Customer view model might be backed by a persistent business object that is loaded and saved with a database or fetched and stored from web services. Or you might implement INotifyPropertyChanged on that real business object itself without an intermediate "view model" representation of it.
Inheritance: INotifyPropertyChanged
Mostra file Open project: Claytonious/spinnaker

Public Methods

Method Description
ClearDirty ( ) : void
Customer ( ) : System
Save ( ) : void

This would save the changes made to the Customer to a database or web service. In this sample, we don't really do any persistence, so we simply clear the IsDirty flag to pretend that the Customer has been saved.

Private Methods

Method Description
RaisePropertyChanged ( string propName ) : void

We wrap raising property changes in a method so that we can always make this Customer dirty when one of its properties changes.

Method Details

ClearDirty() public method

public ClearDirty ( ) : void
return void

Customer() public method

public Customer ( ) : System
return System

Save() public method

This would save the changes made to the Customer to a database or web service. In this sample, we don't really do any persistence, so we simply clear the IsDirty flag to pretend that the Customer has been saved.
public Save ( ) : void
return void