public Task SetCastRenderer(string host, int port) { if (!AvailableDevices.Any(d => d.Host == host && d.Port == port)) { AvailableDevices.Add(Receiver.Default(host, port)); } var renderer = AvailableDevices.Find(d => d.Host == host && d.Port == port); return(SetCastRenderer(renderer)); }
async Task LoadAvailableDevicesAsync() { try { IsLoadingDevices = true; var availableNetworks = await DeviceDriveManager.Current.GetAvailableDevicesAsync(null); foreach (var network in availableNetworks) { AvailableDevices.Add(network); } // We have a list of devices, do nothing, just wait for a device selection IsWaitingForNetwork = false; WaitingLabel = string.Empty; IsLoadingDevices = false; NoDevicesFoundVisible = !AvailableDevices.Any(); } catch (TaskCanceledException) { // Swallow } }