コード例 #1
0
 public CatalogViewModel(IDomainContext domainContext)
 {
     isInited      = false;
     HasError      = new BoolHolder();
     DomainContext = domainContext;
     HasChanges    = false;
     ShowPhotoOnMouseDoubleClick = false;
     RefreshView          = delegate { };
     RefreshDirectoryView = delegate { };
     RefreshBrandView     = delegate { };
     RefreshCatalogView   = delegate { };
     SetEnabled           = delegate { };
     HasResultGridErrors  = () => false;
     loadTimer            = new Timer();
     loadTimer.Interval   = 300; TimeSpan.FromMilliseconds(10);
     loadTimer.Elapsed   += LoadData_Tick;
     //loadQueue = new Queue<Action>();
     Model = new CatalogModel(domainContext);
     CatalogNavigateViewModel  = new CatalogNavigateViewModel(this, Model);
     CatalogDirectoryViewModel = new CatalogDirectoryViewModel(domainContext, Model?.SearchCriteria);
     CatalogBrandViewModel     = new CatalogBrandViewModel(domainContext, Model?.SearchCriteria);
     SubscribeEvents();
     SubscribeMessenger();
     InitCommands();
 }
コード例 #2
0
        private object LoadBrands(bool needToUpdate)
        {
            if (needToUpdate)
            {
                CatalogBrandViewModel.Refresh();
                DomainContext?.SetWaitMessage(AsyncOperationType.LoadCatalog);
                LoadPricelist(true);
            }

            return(needToUpdate);
        }