private void Callback_ServiceCallbackEvent(object sender, ChangePasswordEventArgs e) { this.timer.Stop(); this.currentPass.Text = e.Password; this.remainingSecondsProgress.Dispatcher.Invoke(() => { this.remainingSecondsProgress.Value = this.remainingSecondsProgress.Maximum = e.NextChange.Subtract(DateTime.UtcNow).TotalSeconds; }); this.timer.Start(); }
private void OnServiceCallbackEvent(object state) { EventHandler <ChangePasswordEventArgs> handler = ServiceCallbackEvent; ChangePasswordEventArgs e = state as ChangePasswordEventArgs; if (handler != null) { handler(this, e); } }