private void updateNetworks() { var networks = handler.GetNetworks(); networksPage.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { networksPage.setNetworks(networks); })); }
private void run() { try { while (runThread.IsAlive) { APIHandler handler = APIHandler.Instance; if (handler != null) { handler.GetNetworks(apiNetworkCallback); handler.GetStatus(apiStatusCallback); } Thread.Sleep(2000); } } catch { Console.WriteLine("Monitor Thread Ended"); } }