예제 #1
0
파일: Home.xaml.cs 프로젝트: zhangsht/uwp
 /// <summary>
 /// 收藏,若已收藏过,提示错误
 /// </summary>
 private void FavoriteButton_Click(object sender, RoutedEventArgs e)
 {
     if (SelectedItem != null)
     {
         if (UserDB.AddFavorite(SelectedItem))
         {
             NotifyPopup notifyPopup = new NotifyPopup("收藏成功!");
             notifyPopup.Show();
         }
         else
         {
             NotifyPopup notifyPopup = new NotifyPopup("收藏已存在!");
             notifyPopup.Show();
         }
     }
 }