开发者

decorating viewmodel with user defined types

开发者 https://www.devze.com 2023-04-04 12:39 出处:网络
This is my view model. I would like to decorate my properties in it. where regionLists is a drop down list and UnAssignedStatesLists, AssignedStatesListsare list boxes. RegionLists ddl should be selec

This is my view model. I would like to decorate my properties in it. where regionLists is a drop down list and UnAssignedStatesLists, AssignedStatesLists are list boxes. RegionLists ddl should be selected and atleast one item should be moved from UnAssignedStatesLists to AssignedStatesLists. how to I decorate them?

public class RegionOrStateAssignmentModel : IRegionOrStateAssignmentModel
{
    #region Constructor / Destructor
    public RegionOrStateAssignmentModel()
    {
        RegionLists = new List<IRegion>();
        UnAssignedStatesLists = new List<ICode>();
        AssignedStatesLists = new List<ICode>();
    }
    ~RegionOrStateAssignmentModel()
    {
        RegionLists = null;
        UnAssignedStatesLists = null;
        AssignedStatesLists = null;
    }
    #endregion

    #region Properties
    public List<IRegion> RegionLists { get; set; }
    public IRegion Re开发者_运维技巧gionSelected { get; set; }
    public List<ICode> UnAssignedStatesLists { get; set; }
    public List<ICode> AssignedStatesLists { get; set; }
    #endregion
} 

where IRegion is as below

public interface IRegion
{
    int RegionId { get; set; }
    string Name { get; set; }
    string Description { get; set; }
    ICode Status { get; set; }
    string CreatedBy { get; set; }
    DateTime CreateDate { get; set; }
    string ModifiedBy { get; set; }
    DateTime ModifiedDate { get; set; }
    List<ICode> States { get; set; }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消