Пример #1
0
        private async void GetLaternaRequest()
        {
            try
            {
                List <Laterna> laternaList = new List <Laterna>();
                LaternaModel   model       = await App.Client.GetLaternas();

                if (model.status == "true")
                {
                    for (int i = 0; i < model.feeds.Count; i++)
                    {
                        var laterna = new Laterna()
                        {
                            id       = model.feeds[i].id,
                            priority = model.feeds[i].priority,
                            audio    = model.feeds[i].audio,
                            splash   = model.filebase + model.feeds[i].splash,
                            program  = model.feeds[i].program,
                            active   = model.feeds[i].active
                        };

                        laternaList.Add(laterna);
                    }

                    laternaListView.ItemsSource = laternaList;
                }
            }

            catch (Exception)
            {
            }
        }
Пример #2
0
        private void laternaListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Laterna item = laternaListView.SelectedItem as Laterna;

            if (item == null)
            {
                return;
            }

            IsLoadLaterna = true;

            laternaPlayerButton.Source         = new BitmapImage(new Uri("ms-appx:///Assets/Icons/pause.png"));
            laternaPlayerPanel.Visibility      = Visibility.Visible;
            laternaPlayerTitle.Text            = item.program;
            laternaPlayer.Source               = new Uri(item.audio);
            laternaPlayer.CurrentStateChanged += LaternaPlayer_CurrentStateChanged;
        }