private void BtnPlay_Click(object sender, RoutedEventArgs e) { if (senderView.SelectedIndex == 0) { RItem item = (RItem)senderView.SelectedItem; VlcControl.SourceProvider.MediaPlayer.Play(new Uri(item.Url)); //MessageBox.Show(item.Url.Length.ToString()); lblStation.Content = String.Format("Station: {0}", item.Name.ToString()); Enabled = true; btnStop.IsEnabled = true; IsPlaying = true; } else if (senderView.SelectedIndex < 0) { MessageBox.Show("No Item Found"); } }
public void SenderListeLaden() { try { string[] array = GetStreamList(); for (int i = 0; i < array.Length - 1; i += 2) { RItem item = new RItem { Name = array[i], Url = array[i + 1] }; senderView.Items.Add(item); } }catch (IndexOutOfRangeException e) { MessageBox.Show(String.Format("Sie haben ein Fehler: {0}", e.ToString())); }catch (Exception e) { MessageBox.Show(String.Format("Sie haben ein Fehler: {0}", e.ToString())); } }