public SongDetailsPage() { itemCollections = CurrentItemCollections.Instance(); InitializeComponent(); InitializeElements(); InitializePlayer(); }
private void PageLoaded(object sender, RoutedEventArgs e) { itemCollections = CurrentItemCollections.Instance(); currentTag = itemCollections.currentMood; this.SetValue(RadTileAnimation.ContainerToAnimateProperty, this.songList); if (currentTag != null) { if (currentTag.type.ToLower().Equals(Constants.TYPE_ACTIVITY)) { tagTitle.Text = "hey! go on, " + currentTag.value; } else if (currentTag.type.ToLower().Equals(Constants.TYPE_MOOD)) { tagTitle.Text = "I'm feeling " + currentTag.value; } else if (currentTag.type.ToLower().Equals(Constants.TYPE_ACTIVITY)) { tagTitle.Text = "hey! go on, " + currentTag.value; } } if (NetworkInterface.GetIsNetworkAvailable()) { if (searchResult != null && searchResult.tracksTotal > 0) { songs = searchResult.trackList; songList.ItemsSource = songs; if (currentTag != null && !itemCollections.getSongsForTagDictionary().ContainsKey(currentTag.value)) { itemCollections.getSongsForTagDictionary().Add(currentTag.value, songs); } } else { NotificationTool.Show("Sorry", "Couldn't load songs. Please try once again.", new NotificationAction("Okay", () => { throw new Exception(); })); } } else { NotificationTool.Show("Offline", "Sorry, the network is not available at the moment", new NotificationAction("Okay :(", () => { })); } }
public static CurrentItemCollections Instance() { return instance = instance ?? new CurrentItemCollections(); }