Example #1
0
        protected override void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);

            if (CatalogId <= 0)
            {
                throw new ArgumentException("CatalogId is not set in CatalogPageViewModel.");
            }

            var catalog = CatalogRepository.Get(CatalogId);

            if (catalog == null)
            {
                return;
            }

            CatalogReader = CatalogReaderFactory.Create(catalog);

            if (StartSearch && SavedInTombstone)
            {
                LoadState(ToString());
                if (!string.IsNullOrEmpty(SearchQuery))
                {
                    Search();
                }
            }
        }
        protected override void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);

            if (CatalogId <= 0)
            {
                throw new ArgumentException("CatalogId is not set in CatalogPageViewModel.");
            }

            _catalog = CatalogRepository.Get(CatalogId);
            if (_catalog == null)
            {
                return;
            }

            _catalogAuthorizationService = _catalogAuthorizationFactory.GetAuthorizationService(_catalog);
            NotifyOfPropertyChange("IsAuthorized");

            CatalogReader = CatalogReaderFactory.Create(_catalog);

            if (SavedInTombstone)
            {
                LoadState(ToString());
            }

            LoadItems();
        }