|
using ViewableCollectionDemo.ViewModels.ObjectModel;
namespace ViewableCollectionDemo.ViewModels.Application
{
/// <summary>
/// This class describes one contact, in a presentation-friendly manner.
/// </summary>
public class ContactViewModel : ObservableObject
{
private string _firstName = "New";
/// <summary>
/// This property stores the contact's first name.
/// </summary>
public string FirstName
{
get
{
return _firstName;
}
set
{
if (_firstName != value)
{
_firstName = value;
base.RaisePropertyChanged("FirstName");
}
}
}
private string _lastName = "Contact";
/// <summary>
/// This property stores the contact's last name
/// </summary>
public string LastName
{
get
{
return _lastName;
}
set
{
if (_lastName != value)
{
_lastName = value;
base.RaisePropertyChanged("LastName");
}
}
}
/// <summary>
/// Returns a System.String representing this contact.
/// </summary>
/// <returns>A string formatted to have Last Name, First Name.</returns>
public override string ToString()
{
return string.Format("{0}, {1}", this.LastName, this.FirstName);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Sanjay was weaned on VB6, then was dragged kicking and screaming into the world of .NET development, with VB.NET. He was pleasantly surprised, and quickly migrated existing projects to reap the benefits of the massive .NET libraries.
Quite a while ago, he started a pet project that involved fading in and out controls (as well as other animations) in a Windows Forms application. After weeks of hard work, he finally realized that there had to be a better way.
He found WPF.
He changed his main programming language to C#, and has never looked back.