/// <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)
 {
     // Fetch the job object and assign the values to be bound to the various controls
     job = await JobDataSource.GetDetailsAsync(e.NavigationParameter.ToString());            
     this.DefaultViewModel["JobHistory"] = job.JobHistory;
     this.DefaultViewModel["JobSummaryItems"] = new ObservableCollection<Job>(new List<Job> { job });
     this.DefaultViewModel["JobStockItems"] = await EquipmentDataSource.GetListAsync_Dummy(job.EquipmentIds);
 }
Example #2
0
        /// <summary>
        /// This method takes a Job as its input and generates an XML Document which contains the actual values to
        /// be displayed in the live tile.
        /// </summary>
        /// <param name="job">An object of Job class for getting the actual content to be shown</param>
        /// <returns>An XML document which is used for generating the live tile content</returns>
        private XmlDocument CreateWideTile(Job job)
        {
            // Create a live update for a wide tile
            XmlDocument wideTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Text01);

            // Assign text
            XmlNodeList wideTileTextAttributes = wideTileXml.GetElementsByTagName("text");
            wideTileTextAttributes[0].AppendChild(wideTileXml.CreateTextNode(job.JobNumber + " - " + job.JobId));
            wideTileTextAttributes[1].AppendChild(wideTileXml.CreateTextNode(job.Title));

            return wideTileXml;
        }