private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { client = new BoardClient(IPAddress.Parse("127.0.0.1"), 11000); client.StartClient(); Task.Run(CheckConnection); Content = new LoginPage(client, this); }
/// <summary> /// Background connection check /// </summary> private void CheckConnection() { while (true) { if (!client.Connected) { client.StartClient(); } } }