private void ConnectionStatusChanged(object sender, TriggeredConnectState e) { DispatcherHelper.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { ConnectMessages.Add(GetMessageForStatus(e)); if (e == TriggeredConnectState.Completed) { IsConnecting = false; CanSend = true; } if (e == TriggeredConnectState.Failed) { Reset(); } }); }
private void PeersFound(object sender, IEnumerable <PeerInformation> args) { DispatcherHelper.UIDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { Peers.Clear(); args.ForEach(Peers.Add); if (Peers.Count > 0) { SelectedPeer = Peers.First(); } else { ConnectMessages.Add("No contacts found"); Reset(); } }); }