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

This view model is a bindable collection of Customers. It is simply responsible for loading and exposing a collection of Customers which are also view models themselves. In a real application, this view model make queries against an application's data layer to load its Customers.
Inheritance: INotifyPropertyChanged
Mostrar archivo Open project: Claytonious/spinnaker

Public Methods

Method Description
CustomersViewModel ( ) : System
Delete ( string indexArg ) : void

Delete a customer from the collection. In a real application, this method would probably also delete the customer from persistent storage.

Filter ( ) : void

Applies the current filter text against the collection. All this does is raise a PropertyChanged event, since the actual work of filtering is simply a byproduct of iterating through the collection.

LoadCustomers ( ) : void

Pretends to load a collection of customers from persistent storage like a database or a web service. Since this sample doesn't do any real persistence, this method creates a random set of customers that look like they were loaded from storage.

Private Methods

Method Description
GetRandomItem ( string items ) : string
GetRandomStreetName ( ) : string

Method Details

CustomersViewModel() public method

public CustomersViewModel ( ) : System
return System

Delete() public method

Delete a customer from the collection. In a real application, this method would probably also delete the customer from persistent storage.
public Delete ( string indexArg ) : void
indexArg string
return void

Filter() public method

Applies the current filter text against the collection. All this does is raise a PropertyChanged event, since the actual work of filtering is simply a byproduct of iterating through the collection.
public Filter ( ) : void
return void

LoadCustomers() public method

Pretends to load a collection of customers from persistent storage like a database or a web service. Since this sample doesn't do any real persistence, this method creates a random set of customers that look like they were loaded from storage.
public LoadCustomers ( ) : void
return void