private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { //Start the .Gif (Play and make visible) free to interact with UI in progressChanged. LoadSpinner.Play(); LoadSpinner.Visibility = Visibility.Visible; try { loginUser = SQLuserAccess.UserLogin(username, password); if (loginUser != null) { if (username == loginUser.Username && password == loginUser.Password) { } else { lblInvalidText.Visibility = Visibility.Visible; } } else { lblInvalidText.Visibility = Visibility.Visible; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void LoadSpinner_MediaEnded(object sender, RoutedEventArgs e) { LoadSpinner.Position = new TimeSpan(0, 0, 1); LoadSpinner.Play(); }