2: Create the ListViewData class


The ListViewData contains the Contact object. The Contact class is just a POCO helper for storing all information about a contact .

The listing 3 below shows the ListViewData class:
public class ListViewData : AbstractBaseData
{
    private Contact contact;
    public Contact Contact
    {
        get 
        {
            if (contact == null) contact = new Contact();
            return contact; 
        }
        set
        {
            contact = value;
            PropertyHasChanged("Contact");
        }
    }

    private Contact contactSelected;
    public Contact ContactSelected
    {
        get { return contactSelected; }
        set
        {
            contactSelected = value;
            PropertyHasChanged("ContactSelected");
        }
    }

    private BindingList<Contact> listOfContact;
    public BindingList<Contact> ListOfContact
    {
        get
        {
            if (listOfContact == null) listOfContact = new BindingList<Contact>();
            return listOfContact;
        }
        set
        {
            listOfContact = value;
            PropertyHasChanged("ListOfContact");
        }
    }
}


Last edited Jun 22, 2009 at 9:58 AM by koossery, version 2

Comments

No comments yet.