public void AddSelectedClient(ClientInfoListItemViewModel clientInfoItemVm) { if (clientInfoItemVm != null) { var trustedClientInfo = clientInfoItemVm.GetClientInfo(); var added = MainViewModel.WindowsClient.TrusedClientsInfos.TryAddTrustedClient(trustedClientInfo); if (added) { var addedClientEvent = new TrustedClientEvent(); addedClientEvent.AddedTrustedClientInfos.Add(trustedClientInfo); _conductor.EventAggregator.PublishOnUIThread(addedClientEvent); } } }
private void UpdateAvailableClients() { const int delayInterval = 5000; while (true) { NetworkScanner.RequestUpdate.Cancel(); var clientInfos = MainViewModel.WindowsClient.GetClientInfos(); foreach (ClientInfo clientInfo in clientInfos) { var clientVm = new ClientInfoListItemViewModel(clientInfo); if (!AvailableClients.Contains(clientVm)) { AvailableClients.Add(clientVm); } } Task.Delay(delayInterval).Wait(); } }