/// <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="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { // Allow saved page state to override the initial item to display App app = (App)Application.Current; incident= app.ActiveIncident; ActiveDeployment = app.ActiveMap; DataContext = incident; CategoryTextBlock.Text = " "; foreach (Category cat in incident.categories) { CategoryTextBlock.Text += cat.category.title + " | "; } Pushpin pushpin = new Pushpin(); pushpin.Tag = incident.incident.incidenttitle; // pushpin.Text = incident.incident.incidentdescription; Location location = new Location() { Latitude = incident.incident.Latitude, Longitude = incident.incident.Longitude }; ToolTipService.SetToolTip(pushpin, incident.incident.incidenttitle); MapLayer.SetPosition(pushpin, location); ReportMap.Children.Add(pushpin); ReportMap.SetView(location, 14); }
private bool GetShareContent(DataRequest request) { bool succeeded = false; App app = (App)Application.Current; incident = app.ActiveIncident; ActiveDeployment = app.ActiveMap; Uri dataPackageUri = ValidateAndGetUri(ActiveDeployment.url + "reports/view/"+incident.incident.incidentid); if (dataPackageUri != null) { request.Data.SetUri(dataPackageUri); request.Data.Properties.Title = incident.incident.incidenttitle+" @ushahidi 4 #Windows8"; request.Data.Properties.Description = incident.incident.incidentdescription; //request.Data.SetText( // "@Ushahidi Deployment, " + ": " + incident.incident.incidentdescription.Substring(0, 50) + " " // ); succeeded = true; } else { request.FailWithDisplayText("Enter the link you would like to share and try again."); } return succeeded; }