private async void SendSceneCommand() { if (SelectedHueScene != null) { IsLoading = true; var appliance = Appliances.FirstOrDefault() as Light; if (appliance != null && SelectedHueScene != null) { try { var client = new HueClient(appliance.HueUser); await client.SendCommandAsync(SelectedHueScene); HueGroup = await client.GetHueGroupByIdAsync(HueGroup.Id); } catch (Exception ex) { DebugHelper.Debugger.WriteErrorLog("Error occurred while sending scene command.", ex); await new MessageDialog("Error occurred while sending scene command: " + ex.Message).ShowAsync(); } } IsLoading = false; } }