Files
BrightSharp.Toolkit/BrightSharp.Ui.Tests/ListViewItemModel.cs

138 lines
4.0 KiB
C#
Raw Permalink Normal View History

2017-08-27 13:05:14 +03:00
using System;
2017-01-09 13:25:52 +03:00
using System.ComponentModel;
2017-08-27 13:05:14 +03:00
using System.Runtime.CompilerServices;
2017-01-09 13:25:52 +03:00
namespace BrightSharp.Ui.Tests
{
2017-08-27 13:05:14 +03:00
public class CustomerViewModel : INotifyPropertyChanged
2017-01-09 13:25:52 +03:00
{
static Random rnd = new Random();
private string _customerId;
private string _companyName;
private string _contactName;
private string _contactTitle;
private string _address;
private string _city;
private string _region;
private string _postalCode;
private string _country;
private string _phone;
private string _fax;
private string _color;
2017-08-27 13:05:14 +03:00
private int? _numberProperty;
public event PropertyChangedEventHandler PropertyChanged;
2017-01-09 13:25:52 +03:00
public CustomerViewModel()
{
byte[] colorBytes = new byte[3];
rnd.NextBytes(colorBytes);
Color = System.Windows.Media.Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]).ToString();
}
public string CustomerID
{
get { return _customerId; }
2017-08-27 13:05:14 +03:00
set { _customerId = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
2017-08-27 13:05:14 +03:00
2017-01-09 13:25:52 +03:00
public string CompanyName
{
get { return _companyName; }
2017-08-27 13:05:14 +03:00
set { _companyName = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
2017-02-18 00:15:59 +03:00
public string ContactNameCN
2017-01-09 13:25:52 +03:00
{
get { return _contactName; }
2017-08-27 13:05:14 +03:00
set { _contactName = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
public string ContactTitle
{
get { return _contactTitle; }
2017-08-27 13:05:14 +03:00
set { _contactTitle = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Location")]
public string Address
{
get { return _address; }
2017-08-27 13:05:14 +03:00
set { _address = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Location")]
public string City
{
get { return _city; }
2017-08-27 13:05:14 +03:00
set { _city = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Location")]
public string Region
{
get { return _region; }
2017-08-27 13:05:14 +03:00
set { _region = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Contact Information")]
[Description("Postal code for Customer")]
public string PostalCode
{
get { return _postalCode; }
2017-08-27 13:05:14 +03:00
set { _postalCode = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Location")]
[Description("Country for Customer")]
public string Country
{
get { return _country; }
2017-08-27 13:05:14 +03:00
set { _country = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Contact Information")]
[Description("Phone for Customer")]
public string Phone
{
get { return _phone; }
2017-08-27 13:05:14 +03:00
set { _phone = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Contact Information")]
[Description("Fax for Customer")]
public string Fax
{
get { return _fax; }
2017-08-27 13:05:14 +03:00
set { _fax = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
[Category("Appearance")]
public string Color
{
get { return _color; }
2017-08-27 13:05:14 +03:00
set { _color = value; RaisePropertyChanged(); }
}
public int? NumberProperty
{
get { return _numberProperty; }
set { _numberProperty = value; RaisePropertyChanged(); }
2017-01-09 13:25:52 +03:00
}
public double DoubleNumberProperty { get; set; }
[Category("PropertyGrid Explore Group")]
[Description("Indicates that Customer is has active state")]
[DisplayName("Is Active")]
public bool IsActive { get; set; }
[Category("PropertyGrid Explore Group")]
[Description("Indicates that Customer is has active state or it absent")]
[DisplayName("Is Active Or Not Exists")]
public bool? IsActiveOrEmpty { get; set; }
2017-08-27 13:05:14 +03:00
private void RaisePropertyChanged([CallerMemberName]string memeberName = null) {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(memeberName));
}
2017-01-09 13:25:52 +03:00
}
}