/// <summary> /// 删除收藏并提示 /// </summary> private void DeleteFavoriteButton_Click(object sender, RoutedEventArgs e) { if (SelectedItem != null) { UserDB.DeleteFavorite(SelectedItem); // 从数据库删除 F_ViewModel.RemoveMessageItem(SelectedItem.guid); // 从ViewModel删除 SelectedItem = null; NotifyPopup notifyPopup = new NotifyPopup("删除收藏成功!"); notifyPopup.Show(); } }
/// <summary> /// 点击Item, 显示相应网页。若当前宽度太小,跳转至新页面显示 /// </summary> private void MessageItemListView_ItemClick(object sender, ItemClickEventArgs e) { SelectedItem = (e.ClickedItem as Models.MessageItem); SelectedItem = (e.ClickedItem as Models.MessageItem); if (SelectedItem.guid != null) { this.MyWebView.Navigate(new Uri(SelectedItem.guid)); } if (WebViewGrid.Visibility == Visibility.Collapsed) { Frame.Navigate(typeof(MinWindow), SelectedItem.guid); } }