/// <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> /// This method takes a Product as its input and generates an XML Document which contains /// the actual values to be displayed in the live tile. /// </summary> /// <param name="product">An object of Product class</param> /// <returns>An XML document which is used for generating the live tile content</returns> private XmlDocument CreateWideTile(Product product) { // Create a live update for a wide tile XmlDocument wideTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150SmallImageAndText04); // Assign text XmlNodeList wideTileTextAttributes = wideTileXml.GetElementsByTagName("text"); wideTileTextAttributes[0].AppendChild(wideTileXml.CreateTextNode(product.ProductCategory)); wideTileTextAttributes[1].AppendChild(wideTileXml.CreateTextNode(product.ProductName)); // Assign Image XmlNodeList wideTileImageAttributes = wideTileXml.GetElementsByTagName("image"); ((XmlElement)wideTileImageAttributes[0]).SetAttribute("src", product.ProductImage); ((XmlElement)wideTileImageAttributes[0]).SetAttribute("alt", "Contoso FinServ Product Image"); return wideTileXml; }