public ProductListingViewModel()
        {
            CategoryId   = "1";
            CategoryName = "CategoryName";
            PivotItems   = new List <SubCategoryDisplayItem>();

            if (DesignMode.DesignModeEnabled)
            {
                //Generate Fake Design Time Data.
                foreach (var subCategory in DesignTimeDataService.GenerateAudioSubCategories())
                {
                    var sc   = new SubCategoryDisplayItem("1", "Audio", subCategory);
                    var prds = new List <Product>();
                    prds.AddRange(DesignTimeDataService.GenerateFavoriteProducts(9, "Fabrikam"));
                    prds.AddRange(DesignTimeDataService.GenerateFavoriteProducts(4, "Contoso"));
                    prds.AddRange(DesignTimeDataService.GenerateFavoriteProducts(7, "Proseware"));
                    sc.AllProducts      = new List <Product>(prds);
                    sc.FilteredProducts = new List <Product>(prds);
                    sc.CurrentFilters.Add(new ProductListFilterItem("$222 - $333", "Price Range", false));
                    sc.CurrentFilters.Add(new ProductListFilterItem("32", "Megabytes", false));
                    sc.CurrentFilters.Add(new ProductListFilterItem("5x", "Optical Zoom", false));
                    if (PivotItems.Count == 0)
                    {
                        SelectedPivot = sc;
                    }
                    PivotItems.Add(sc);
                }
                FavoriteItems  = DesignTimeDataService.GenerateFavoriteProducts(4);
                HasInitialized = true;
            }
        }
 public ViewProductViewModel()
 {
     if (DesignMode.DesignModeEnabled)
     {
         ProductDetails  = DesignTimeDataService.GenerateProduct();
         ProductName     = ProductDetails.Name;
         CategoryName    = "Cameras";
         SubCategoryName = "SLR Cameras";
         RelatedProducts = DesignTimeDataService.GenerateFavoriteProducts(5);
     }
     IsPinned   = false;
     IsFavorite = false;
 }
Пример #3
0
        public SearchResultsViewModel()
        {
            IsWindowsPhone = DeviceFamilyHelper.CurrentDeviceFamily() == DeviceFamily.Mobile;
            IsInitializing = true;
            SearchPhrase   = "";
            PivotItems     = new ObservableCollection <SearchGroupDisplayItem>();

            if (DesignMode.DesignModeEnabled)
            {
                PivotItems.Add(new SearchGroupDisplayItem("0", "All", DesignTimeDataService.GenerateFavoriteProducts(12), true, null));
                PivotItems.Add(new SearchGroupDisplayItem("1", "Audio", DesignTimeDataService.GenerateFavoriteProducts(8), false, null));
                PivotItems.Add(new SearchGroupDisplayItem("2", "Cameras", DesignTimeDataService.GenerateFavoriteProducts(6), false, null));
                PivotItems.Add(new SearchGroupDisplayItem("4", "Home Appliances", DesignTimeDataService.GenerateFavoriteProducts(3), false, null));
                SearchPhrase   = "MYPHRASE";
                IsInitializing = false;
                HasInitialized = true;
            }
        }