Esempio n. 1
0
 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));
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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);
            }
        }