/// <summary> /// The connect. /// </summary> /// <param name="connectionString"> /// The connection string. /// </param> private void Connect(string connectionString) { if (!string.IsNullOrEmpty(connectionString)) { try { Mouse.OverrideCursor = Cursors.Wait; DatabaseSession.Connect(connectionString); } catch { this.connectionError.Visibility = Visibility.Visible; this.timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(8) }; this.timer.Tick += (t, tick) => this.CollapseConnectionErrorMessage(); this.timer.Start(); } finally { Mouse.OverrideCursor = null; } } }