public void PinToStart(object sender, Favorite item)
        {
            FixUpBindingIssue(sender);

            string navigationUrl = String.Format(
                "/Views/StationInfo/StationInfoPivotPage.xaml?NavigationStationId={0}", item.HaltestellenId);

            if (null != FindTile(navigationUrl))
            {
                _uiService.ShowTextToast(AppResources.Favorites_Favorite_AlreadyPinned, item.Bezeichnung);
                return;
            }

            ShellTileData tile = new StandardTileData
            {
                Title = item.Bezeichnung,
                BackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMediumSecondaryTile.png", UriKind.Relative),
            };

            ShellTile.Create(new Uri(navigationUrl, UriKind.Relative), tile);
        }
 public async Task DeleteFavoriteAsync(Favorite fav)
 {
     var db = new RuntimeDataContext();
     await db.DeleteFavoriteAsync(fav).ConfigureAwait(false);
 }
        public async Task InsertFavoriteIfNotExistsAsync(Favorite fav)
        {
            var db = new RuntimeDataContext();

            bool exists = await db.DoesFavoriteExistAsync(fav.HaltestellenId).ConfigureAwait(false);
            
            if (!exists)
            {
                await db.InsertFavoriteAsync(fav).ConfigureAwait(false);
            }
        }
 public async void Remove(object sender, Favorite item)
 {
     FixUpBindingIssue(sender);
     PerformRemovalAsync(item);
 }
 private async Task PerformRemovalAsync(Favorite item)
 {
     await _dataService.DeleteFavoriteAsync(item);
     await LoadFavoritesAsync();
 }
 public async Task DeleteFavoriteAsync(Favorite fav)
 {
     int result = await _connection.DeleteAsync(fav).ConfigureAwait(false);
 }
 public async Task InsertFavoriteAsync(Favorite fav)
 {
     int result = await _connection.InsertAsync(fav).ConfigureAwait(false);
 }