public async void GetChannelData() { var data = await TwitchApi.GetLiveChannelData(m_channelName); string text = "OFFLINE"; if (data != null) { text = data.CurrentViewerCount.ToString() + " viewers"; } // Don't wait task, just fire and forget. var task = Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action <string>(SetViewers), text); }
async void LoadAsyncData() { var connectTask = Connect(m_channelName); string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); m_cache = System.IO.Path.Combine(path, "TwitchChat"); var task = TwitchApi.GetEmoticonData(m_cache); GetChannelData(); Emoticons = await task; m_channel = await connectTask; }