Exemplo n.º 1
0
        public ShellViewModel()
        {
            DisplayName = Assembly.GetExecutingAssembly().GetName().Name;

            var items = new List <DomainRecord>();

            var father = new ParentRecord {
                Id = 999, Name = "Big Daddy"
            };
            var mother = new ParentRecord {
                Id = 1001, Name = "Little Momma"
            };

            items.Add(new DomainRecord {
                Name = "First", Parent = father, State = StateEnum.Default
            });
            items.Add(new DomainRecord {
                Name = "Second", Parent = mother, State = StateEnum.Default
            });

            _detail = new DomainRecordDetailViewModel();
            _detail.Parents.AddRange(new[] { father, mother }.Select(p => new NameWrapper <ParentRecord>(p.Name, p)));

            _master = new DomainRecordMasterViewModel(items, _detail);
        }
 public DomainRecordMasterViewModel(
     IEnumerable <DomainRecord> items,
     DomainRecordDetailViewModel itemDetail)
     : base(items, t => new DomainRecordDetailListViewModel(t), i => itemDetail.Item = i)
 {
     ItemDetail = itemDetail;
 }