diff --git a/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs b/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs
index 420114d0..74e009ca 100644
--- a/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs
+++ b/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs
@@ -946,12 +946,14 @@ namespace SafeExamBrowser.Client.UnitTests
settings.ActionCenter.EnableActionCenter = true;
sut.TryStart();
- actionCenter.Verify(t => t.Show(), Times.Once);
+ actionCenter.Verify(t => t.Promote(), Times.Once);
+ actionCenter.Verify(t => t.Show(), Times.Never);
actionCenter.Reset();
operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Aborted);
sut.TryStart();
+ actionCenter.Verify(t => t.Promote(), Times.Never);
actionCenter.Verify(t => t.Show(), Times.Never);
actionCenter.Reset();
@@ -959,6 +961,7 @@ namespace SafeExamBrowser.Client.UnitTests
operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Success);
sut.TryStart();
+ actionCenter.Verify(t => t.Promote(), Times.Never);
actionCenter.Verify(t => t.Show(), Times.Never);
}
diff --git a/SafeExamBrowser.Client/ClientController.cs b/SafeExamBrowser.Client/ClientController.cs
index 5314fce7..bbef75f0 100644
--- a/SafeExamBrowser.Client/ClientController.cs
+++ b/SafeExamBrowser.Client/ClientController.cs
@@ -238,7 +238,7 @@ namespace SafeExamBrowser.Client
{
if (Settings.ActionCenter.EnableActionCenter)
{
- actionCenter.Show();
+ actionCenter.Promote();
}
if (Settings.Taskbar.EnableTaskbar)
diff --git a/SafeExamBrowser.UserInterface.Contracts/Shell/IActionCenter.cs b/SafeExamBrowser.UserInterface.Contracts/Shell/IActionCenter.cs
index bac238a2..e60e7fa2 100644
--- a/SafeExamBrowser.UserInterface.Contracts/Shell/IActionCenter.cs
+++ b/SafeExamBrowser.UserInterface.Contracts/Shell/IActionCenter.cs
@@ -61,6 +61,11 @@ namespace SafeExamBrowser.UserInterface.Contracts.Shell
///
void InitializeText(IText text);
+ ///
+ /// Makes the action center visible and automatically hides it after a short delay.
+ ///
+ void Promote();
+
///
/// Registers the specified activator to control the visibility of the action center.
///
diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/ActionCenter.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/ActionCenter.xaml.cs
index 6a53c2d7..8c6adfa2 100644
--- a/SafeExamBrowser.UserInterface.Desktop/Windows/ActionCenter.xaml.cs
+++ b/SafeExamBrowser.UserInterface.Desktop/Windows/ActionCenter.xaml.cs
@@ -7,6 +7,8 @@
*/
using System;
+using System.Threading;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Animation;
using SafeExamBrowser.I18n.Contracts;
@@ -87,6 +89,16 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
QuitButton.Text.Text = text.Get(TextKey.Shell_QuitButton);
}
+ public void Promote()
+ {
+ Task.Run(() =>
+ {
+ Dispatcher.Invoke(ShowAnimated);
+ Thread.Sleep(2000);
+ Dispatcher.Invoke(HideAnimated);
+ });
+ }
+
public void Register(IActionCenterActivator activator)
{
activator.Activated += Activator_Activated;
diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/ActionCenter.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/ActionCenter.xaml.cs
index 24e28ca5..2b887036 100644
--- a/SafeExamBrowser.UserInterface.Mobile/Windows/ActionCenter.xaml.cs
+++ b/SafeExamBrowser.UserInterface.Mobile/Windows/ActionCenter.xaml.cs
@@ -7,6 +7,8 @@
*/
using System;
+using System.Threading;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Animation;
using SafeExamBrowser.I18n.Contracts;
@@ -87,6 +89,16 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
QuitButton.Text.Text = text.Get(TextKey.Shell_QuitButton);
}
+ public void Promote()
+ {
+ Task.Run(() =>
+ {
+ Dispatcher.Invoke(ShowAnimated);
+ Thread.Sleep(2000);
+ Dispatcher.Invoke(HideAnimated);
+ });
+ }
+
public void Register(IActionCenterActivator activator)
{
activator.Activated += Activator_Activated;