aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-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.cs16
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)