Exemplo n.º 1
0
        private async Task LoadChromecasts()
        {
            try
            {
                LoadingChromecasts = true;
                var ip = LocalIPAddress().ToString();
                var foundChromecasts = await _chromecastService.StartLocatingDevices(ip);

                foreach (var foundChromecast in foundChromecasts)
                {
                    Chromecasts.Add(foundChromecast);
                }

                LoadingChromecasts = false;
                AnyChromecast      = Chromecasts.Any();
            }
            catch (Exception ex)
            {
                LoadingChromecasts = false;
                AnyChromecast      = false;
                Logger.Error(ex);
                Messenger.Default.Send(
                    new UnhandledExceptionMessage(
                        new PopcornException(LocalizationProviderHelper.GetLocalizedValue <string>("CastFailed"))));
                CancelCommand.Execute(null);
                CloseCommand.Execute(null);
            }
        }
Exemplo n.º 2
0
 private async void LoadChromecasts()
 {
     var foundChromecasts = await _chromecastService.StartLocatingDevices();
     foreach (var foundChromecast in foundChromecasts)
     {
         Chromecasts.Add(foundChromecast);
     }
 }