using System; using System.Collections.ObjectModel; using System.Collections.Specialized; using VmWrapperDemo.Domain; namespace VmWrapperDemo.ViewModel { public class OrderVM : VmObjectBase<Order> { #region Fields // Property variables /* No property variables in this class. */ #endregion #region Constructors /// <summary> /// Constructor that creates a new domain object and wraps it in /// a view model wrapper. /// </summary> /// <remarks> /// This constructor is used when a view model object is created /// by a XAML data binding operation. /// </remarks> public OrderVM() : this(new Order()) { } /// <summary> /// Constructor that wraps an existing domain object in a view /// model wrapper. /// </summary> /// <remarks> /// This constructor is used when a view model object is created /// as part of the initialization of a view model. /// </remarks> public OrderVM(Order domainObject) : base(domainObject) { } #endregion #region Bindable Properties public DateTime Date { get { return base.DomainObject.Date; } set { base.DomainObject.Date = value; base.RaisePropertyChangedEvent("Date"); } } public decimal Amount { get { return base.DomainObject.Amount; } set { base.DomainObject.Amount = value; base.RaisePropertyChangedEvent("Amount"); } } #endregion } }
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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)