public async Task Initialize(Bridge bridge) { _bridge = bridge; List <Light> comlgt = await HueObjectHelper.GetBridgeLightsAsyncTask(_bridge); _gvv = DataContext as GroupViewViewModel; if (comlgt != null) { List <Group> comgrp = await HueObjectHelper.GetBridgeGroupsAsyncTask(_bridge); if (comgrp != null) { _gvv.Initialize(comgrp, comlgt); } else { MessageBoxError.ShowLastErrorMessages(bridge); } DataContext = _gvv; } else { MessageBoxError.ShowLastErrorMessages(bridge); } }
public async Task Initialize() { List <Light> comlgt = await BridgesManager.Instance.SelectedBridge.GetListObjectsAsync <Light>(); _gvv = DataContext as GroupViewViewModel; if (comlgt != null) { List <Group> comgrp = await BridgesManager.Instance.SelectedBridge.GetListObjectsAsync <Group>(); if (comgrp != null) { _gvv.Initialize(comgrp, comlgt); } else { MessageBoxError.ShowLastErrorMessages(BridgesManager.Instance.SelectedBridge); } DataContext = _gvv; } else { MessageBoxError.ShowLastErrorMessages(BridgesManager.Instance.SelectedBridge); } }