public static async Task InitHomeMatic(string address) { // Save address ApplicationData.Current.LocalSettings.Values["address"] = address; // Init API HomeMaticApi = new HomeMaticXmlApi(new Ccu("HomeMatic CCU", address)); if (await HomeMaticApi.CheckConnectionAsync()) { Channels.Clear(); var devices = await HomeMaticApi.GetDevicesAsync(); foreach(var device in devices) { var homeMaticDevice = device as HomeMaticDevice; foreach (var channel in homeMaticDevice.ChannelList) { Channels.Add(channel); } } } else { var dialog = new MessageDialog("Could not connect to your HomeMatic Central", "Connection Error"); await dialog.ShowAsync(); } }