diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs index b87f14b89..883d3f893 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -30,7 +30,7 @@ namespace Tango.PPC.UI.Views { public static LayoutView Instance { get; private set; } private LayoutViewVM _vm; - private System.Timers.Timer _timer; + private DispatcherTimer _timer; public LayoutView() { @@ -39,9 +39,9 @@ namespace Tango.PPC.UI.Views Loaded += (_, __) => _vm = DataContext as LayoutViewVM; techPressElement.RegisterForPreviewMouseOrTouchDown(OnMouseOrTouchDown); techPressElement.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp); - _timer = new System.Timers.Timer(); - _timer.Interval = TimeSpan.FromSeconds(10).TotalMilliseconds; - _timer.Elapsed += _timer_Elapsed; + _timer = new DispatcherTimer(); + _timer.Interval = TimeSpan.FromSeconds(10); + _timer.Tick += _timer_Tick; this.PreviewMouseUp += LayoutView_PreviewMouseUp; } @@ -51,14 +51,10 @@ namespace Tango.PPC.UI.Views _vm.ApplicationManager.ResetScreenLockTimer(); } - private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + private void _timer_Tick(object sender, EventArgs e) { _timer.Stop(); - - Dispatcher.BeginInvoke(new Action(() => - { - _vm.ToggleTechnicianMode(); - })); + _vm.ToggleTechnicianMode(); } private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e) |
