private void DeleteClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (App.IsTrial)
                {
                    //messagebox to prompt to buy
                    var buyAppForDeleteMessageBox = new CustomMessageBox
                    {
                        Height             = 300,
                        Caption            = AppResources.BuyFullVersion,
                        Message            = AppResources.BuyAppForDelete,
                        LeftButtonContent  = AppResources.BuyLabel,
                        RightButtonContent = AppResources.LaterLabel,
                        VerticalAlignment  = VerticalAlignment.Center
                    };

                    buyAppForDeleteMessageBox.Dismissed += BuyAppForDeleteMessageBoxDismissed;
                    buyAppForDeleteMessageBox.Show();

                    return;
                }

                var menuItem = sender as MenuItem;

                if (menuItem != null)
                {
                    var birthday = menuItem.DataContext as FriendBirthday;
                    if (birthday != null)
                    {
                        BirthdayUtility.DeleteFriend(birthday.Id);
                    }
                }

                BindDataContext();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, AppResources.ErrDeleting, MessageBoxButton.OK);
            }
        }
        private void DeleteAppBarClick(object sender, EventArgs e)
        {
            try
            {
                if (App.IsTrial)
                {
                    //messagebox to prompt to buy
                    var buyAppForDeleteMessageBox = new CustomMessageBox
                    {
                        Height             = 300,
                        Caption            = AppResources.BuyFullVersion,
                        Message            = AppResources.BuyAppForDelete,
                        LeftButtonContent  = AppResources.BuyLabel,
                        RightButtonContent = AppResources.LaterLabel,
                        VerticalAlignment  = VerticalAlignment.Center
                    };

                    buyAppForDeleteMessageBox.Dismissed += BuyAppForDeleteMessageBoxDismissed;
                    buyAppForDeleteMessageBox.Show();

                    return;
                }
                //display warning for confirmation
                var result = MessageBox.Show(AppResources.DeleteConfirmMessage, AppResources.DeleteLabel, MessageBoxButton.OKCancel);

                if (!result.Equals(MessageBoxResult.OK))
                {
                    return;
                }

                //check which list is active
                if (MainPagePanorama.SelectedItem.Equals(MostRecentPanorama))
                {
                    if (RecentBirthdayList != null && RecentBirthdayList.SelectedItems != null && RecentBirthdayList.SelectedItems.Count > 0)
                    {
                        foreach (FriendBirthday friend in RecentBirthdayList.SelectedItems)
                        {
                            BirthdayUtility.DeleteFriend(friend.Id);
                        }
                    }
                    else
                    {
                        MessageBox.Show(AppResources.WarnSelectItem, AppResources.WarnTryAgain, MessageBoxButton.OK);
                    }

                    BindDataContext();
                }
                else if (MainPagePanorama.SelectedItem.Equals(AllItemPanorama))
                {
                    if (AllBirthdayList != null && AllBirthdayList.SelectedItems != null && AllBirthdayList.SelectedItems.Count > 0)
                    {
                        foreach (FriendBirthday friend in AllBirthdayList.SelectedItems)
                        {
                            BirthdayUtility.DeleteFriend(friend.Id);
                        }
                    }
                    else
                    {
                        MessageBox.Show(AppResources.WarnSelectItem, AppResources.WarnTryAgain, MessageBoxButton.OK);
                    }

                    BindDataContext();
                }
                else if (MainPagePanorama.SelectedItem.Equals(BirthdayCardPanorama))
                {
                    //if image upload/delete is complete
                    if (NetworkInterface.GetIsNetworkAvailable())
                    {
                        if (BirthdayCardList != null && BirthdayCardList.SelectedItems != null && BirthdayCardList.SelectedItems.Count > 0)
                        {
                            var service      = new AzureStorageService(Services.AzureConnectionString, App.UserPreferences.UserDetails.FacebookId);
                            var items        = BirthdayCardList.SelectedItems;
                            var deletedCards = new List <int>();

                            if (items != null)
                            {
                                foreach (var cardEntity in items.Cast <CardEntity>())
                                {
                                    service.DeleteBlob(Path.GetFileName(cardEntity.Url));
                                    deletedCards.Add(cardEntity.Id);
                                }
                            }

                            var birthdays = DataContext as Birthdays;

                            if (birthdays == null)
                            {
                                return;
                            }

                            var birthdayCards = birthdays.BirthdayCards;

                            foreach (var cardId in deletedCards)
                            {
                                birthdayCards.Remove(birthdayCards.Single(c => c.Id == cardId));
                            }

                            //remove entry fromm database
                            BirthdayUtility.DeleteCards(deletedCards);
                        }
                        else
                        {
                            MessageBox.Show(AppResources.WarnSelectItem, AppResources.WarnTryAgain, MessageBoxButton.OK);
                        }
                    }
                    else
                    {
                        MessageBox.Show(AppResources.WarnInternetMsg, AppResources.WarnNwTitle, MessageBoxButton.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, AppResources.ErrDeleting, MessageBoxButton.OK);
            }
        }