void _spell_StartUseSpell(object sender, EventArgs e) { _counter = 0; C_Culdaun.Visibility = Windows.UI.Xaml.Visibility.Visible; if (Spell.Duration != 0) { C_Timer.Text = Spell.Duration.ToString(); C_Timer.Visibility = Windows.UI.Xaml.Visibility.Visible; } _mouveTimerCuldaun = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(1) }; _mouveTimerCuldaun.Tick += mouveTimerCuldaun_Tick; _mouveTimerCuldaun.Start(); St_Culdaun.Duration = TimeSpan.FromSeconds(_spell.Culdaun); foreach (var item in St_Culdaun.Children) { DoubleAnimationUsingKeyFrames da = item as DoubleAnimationUsingKeyFrames; if (da != null) { da.KeyFrames[1].KeyTime = TimeSpan.FromSeconds(_spell.Culdaun); da.Duration = TimeSpan.FromSeconds(_spell.Culdaun); } } St_Culdaun.Begin(); }
public void StopPause() { if (_mouveTimerCuldaun != null) { _mouveTimerCuldaun.Start(); } St_Culdaun.Resume(); }
public void Pause() { if (_mouveTimerCuldaun != null) { _mouveTimerCuldaun.Stop(); } St_Culdaun.Pause(); }