Example #1
0
 /// <summary>
 /// Create the MasterDetails view model object, with
 /// references to a catalog object and a factory object
 /// </summary>
 protected MasterDetailsViewModelBase(
     CatalogBase <TDomainClass> catalog,
     ViewModelFactoryBase <TDomainClass> factory)
 {
     _catalog = catalog;
     _factory = factory;
     _itemViewModelSelected = null;
     _deleteCommand         = new DeleteCommandBase <TDomainClass, MasterDetailsViewModelBase <TDomainClass> >(_catalog, this);
 }
        public List<ItemViewModelBase<TDomainClass>> GetItemViewModelCollection(CatalogBase<TDomainClass> catalog)
        {
            List<ItemViewModelBase<TDomainClass>> items = new List<ItemViewModelBase<TDomainClass>>();

            foreach (TDomainClass obj in catalog.All)
            {
                items.Add(CreateItemViewModel(obj));
            }

            return items;
        }
 public DeleteCommandBase(CatalogBase <TDomainClass> catalog, TViewModel viewModel)
 {
     _catalog   = catalog;
     _viewModel = viewModel;
 }
Example #4
0
 /// <summary>
 /// Create the page view model object, with reference
 /// to a catalog object.
 /// </summary>
 protected PageViewModelBase(CatalogBase <TDomainClass> catalog)
 {
     _catalog       = catalog;
     _itemSelected  = null;
     _deleteCommand = new DeleteCommandBase <TDomainClass, PageViewModelBase <TDomainClass> >(_catalog, this);
 }