/// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     customer = await CustomerDataSource.GetCustomerDetailsAsync(e.NavigationParameter.ToString());
     this.DefaultViewModel["Customer"] = customer;
     this.DefaultViewModel["CustomerName"] = customer.CustomerName;
     this.DefaultViewModel["Products"] = await ProductDataSource.GetProductListByIDAsync(customer.ProductSummary.ToList());
 }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var customers = await CustomerDataSource.GetCustomerListAsync();
            var groupedCustomers = (from n in customers
                                    group n by n.CustomerName.ToCharArray()[0].ToString()
                                    into alphaGroup
                                    orderby alphaGroup.Key
                                    select new CustomerGroup { Title = alphaGroup.Key, Items = alphaGroup.ToList() }).ToList();
            groupedItemsViewSource.Source = groupedCustomers;

            // Assign the groups as the data source for Zoomed Out view
            (SemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = groupedItemsViewSource.View.CollectionGroups;
        }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var products = await ProductDataSource.GeProductListAsync();
            var groupedCustomers = (from n in products
                                    group n by n.ProductCategory
                                        into alphaGroup
                                        orderby alphaGroup.Key
                                        select new ProductGroup { Title = alphaGroup.Key, Items = alphaGroup.ToList() }).ToList();
            groupedItemsViewSource.Source = groupedCustomers;

            // Assign the groups as the data source for Zoomed Out view
            (SemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = groupedItemsViewSource.View.CollectionGroups;
        }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            product = await ProductDataSource.GetProductDetailsAsync(e.NavigationParameter.ToString());
            this.DefaultViewModel["Product"] = product;
            this.DefaultViewModel["ProductName"] = product.ProductName;
            this.DefaultViewModel["ProductCharacteristics"] = product.ProductCharacteristics;
            this.DefaultViewModel["ProductStatistics"] = product.ProductStatistics;
            this.DefaultViewModel["CustomizationParameters"] = product.CustomizationParameters;
            this.DefaultViewModel["EMI"] = "0.00";

            LoadSliders();                       

        }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {

            this.defaultViewModel["RecentCustomers"] = await CustomerDataSource.GetRecentCustomerListAsync(4);
            this.defaultViewModel["FeaturedProducts"] = await ProductDataSource.GetFeaturedProductListAsync(4);

            // Check the window size and update the Visual State
            UpdateVisualState(Window.Current.Bounds.Width);
        }