public static BitmapImage GetImage(Station station) { if (Utility.StationManager.CheckIfExists(station)) return new BitmapImage(new Uri("/Images/appbar.heart.png", UriKind.Relative)); else return new BitmapImage(new Uri("/Images/appbar.heart.outline.png", UriKind.Relative)); }
public static void Remove(Station station) { string name = station.Name; Station verifier = (from c in MainPageViewModel.Instance.FavoriteStations where c.Name == name select c).Single(); MainPageViewModel.Instance.FavoriteStations.Remove(verifier); }
public static bool CheckIfExists(Station station) { if (station != null) { string name = station.Name; try { Station verifier = (from c in MainPageViewModel.Instance.FavoriteStations where c.Name == name select c).Single(); return true; } catch { return false; } } else return false; }
public static void Pin(Station station) { StandardTileData data = new StandardTileData() { Title = station.Name, BackgroundImage = new Uri(station.Image), BackContent = station.Description }; Uri shellUri = new Uri("/Views/StationPlayer.xaml?station=" + station.JSONID, UriKind.Relative); try { ShellTile.Create(shellUri, data); } catch { ShellTile tile = (from c in ShellTile.ActiveTiles where c.NavigationUri == shellUri select c).First(); tile.Update(data); } }