private async void ButtonAddEndpoints_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrWhiteSpace(TextBoxUrlInput.Text))
            {
                return;
            }
            BeginLoadingIndication();
            var result = await AddHostViewModel.ConnectToHosts(_wuEndpointFactory, _endpointCollection, TextBoxUrlInput.Text);

            StopLoadingIndication();
            if (result.Any(a => a.Success && a.Exception is EndpointNeedsUpgradeException))
            {
                string text =
                    "The following hosts are outdated and should be upgraded:"
                    + Environment.NewLine
                    + String.Join(Environment.NewLine, result.Where(a => a.Success && a.Exception is EndpointNeedsUpgradeException).Select(a => a.Endpoint.FQDN));
                _modalService.ShowMessageBox(text, "Outdated hosts.", MessageType.Info);
            }
            if (result.Any(a => !a.Success))
            {
                TextBoxUrlInput.Text = String.Join(Environment.NewLine, result.Where(a => !a.Success).Select(a => a.Url));
                _modalService.ShowMessageBox(String.Join(Environment.NewLine + Environment.NewLine, result.Where(a => !a.Success).Select(a => a.Url + ": " + a.Exception.Message)), "Connect to hosts", MessageType.Warning);
            }
            else
            {
                Close();
            }
        }
 public async void LoadDataAsync()
 {
     try
     {
         VersionsInUse = await BuildVersionTableAsync();
     }
     catch (Exception e)
     {
         Log.Error("Could not receive version information from connected endpoints.", e);
         ModalService.ShowMessageBox("Could not receive version information from connected endpoints.", "Failed to display version data", MessageType.Error);
     }
 }
        public void OnClosing(CancelEventArgs args)
        {
            var msgResult = svcModal.ShowMessageBox("Exit Confirm", "Are you sure you want to exit app ?", MessageBoxButton.YesNo);

            args.Cancel = (msgResult != true);
        }