public void AddItem(String title, String subtitle, String baseUri, String imagePath, String link, String category, String description, String content) { var matches = Items.Any(x => ((ReadingListDataItem)x).Link == link); if (matches) { return; } var item = new ReadingListDataItem { Title = title, Subtitle = subtitle, Link = link, Category = category, Description = description, Content = content }; if (!string.IsNullOrWhiteSpace(baseUri) && !string.IsNullOrWhiteSpace(imagePath)) { item.SetImage(new Uri(baseUri), imagePath); } else if (!string.IsNullOrWhiteSpace(imagePath)) { item.SetImage(imagePath); } Items.Add(item); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); Debug.WriteLine("DetailPage OnNavigatedTo()"); // Register this page as a share source _dataTransferManager = DataTransferManager.GetForCurrentView(); _dataTransferManager.DataRequested += DataTransferManagerOnDataRequested; // Set the item to the one we received in the NavigateTo() call Item = e.Parameter as ReadingListDataItem; if (Item != null) { pageTitle.Text = Item.Title; Debug.WriteLine("Window height: {0}", Window.Current.Bounds.Height); var content = WrapHtml(Item.Title, Item.Content, Window.Current.Bounds.Height); try { ContentWebView.NavigateToString(content); } catch (Exception) { Debug.WriteLine("ContentWebView.NavigateToString exception!"); } } }
private void navigateToItem(ReadingListDataItem item) { Debug.WriteLine("navigateToItem()"); Frame.Navigate(typeof (DetailPage), item); }