diff --git a/SafeExamBrowser.UserInterface.Mobile/SafeExamBrowser.UserInterface.Mobile.csproj b/SafeExamBrowser.UserInterface.Mobile/SafeExamBrowser.UserInterface.Mobile.csproj
index 44612cb6..bc75f551 100644
--- a/SafeExamBrowser.UserInterface.Mobile/SafeExamBrowser.UserInterface.Mobile.csproj
+++ b/SafeExamBrowser.UserInterface.Mobile/SafeExamBrowser.UserInterface.Mobile.csproj
@@ -172,6 +172,9 @@
Code
+
+ ProctoringWindow.xaml
+
RuntimeWindow.xaml
@@ -480,6 +483,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
diff --git a/SafeExamBrowser.UserInterface.Mobile/UserInterfaceFactory.cs b/SafeExamBrowser.UserInterface.Mobile/UserInterfaceFactory.cs
index a35b36eb..72425f5c 100644
--- a/SafeExamBrowser.UserInterface.Mobile/UserInterfaceFactory.cs
+++ b/SafeExamBrowser.UserInterface.Mobile/UserInterfaceFactory.cs
@@ -165,8 +165,7 @@ namespace SafeExamBrowser.UserInterface.Mobile
public IProctoringWindow CreateProctoringWindow(IProctoringControl control)
{
- // TODO
- throw new System.NotImplementedException();
+ return Application.Current.Dispatcher.Invoke(() => new ProctoringWindow(control));
}
public IRuntimeWindow CreateRuntimeWindow(AppConfig appConfig)
diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml b/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml
new file mode 100644
index 00000000..e37acd0c
--- /dev/null
+++ b/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml
@@ -0,0 +1,8 @@
+
+
diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml.cs
new file mode 100644
index 00000000..cc58b86d
--- /dev/null
+++ b/SafeExamBrowser.UserInterface.Mobile/Windows/ProctoringWindow.xaml.cs
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2021 ETH Zürich, Educational Development and Technology (LET)
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+using System.ComponentModel;
+using System.Windows;
+using SafeExamBrowser.UserInterface.Contracts.Proctoring;
+using SafeExamBrowser.UserInterface.Contracts.Windows;
+using SafeExamBrowser.UserInterface.Contracts.Windows.Events;
+using SafeExamBrowser.UserInterface.Shared.Utilities;
+
+namespace SafeExamBrowser.UserInterface.Mobile.Windows
+{
+ public partial class ProctoringWindow : Window, IProctoringWindow
+ {
+ private WindowClosingEventHandler closing;
+
+ event WindowClosingEventHandler IWindow.Closing
+ {
+ add { closing += value; }
+ remove { closing -= value; }
+ }
+
+ public ProctoringWindow(IProctoringControl control)
+ {
+ InitializeComponent();
+ InitializeWindow(control);
+ }
+
+ public void BringToForeground()
+ {
+ Dispatcher.Invoke(() =>
+ {
+ if (WindowState == WindowState.Minimized)
+ {
+ WindowState = WindowState.Normal;
+ }
+
+ Activate();
+ });
+ }
+
+ public new void Close()
+ {
+ Dispatcher.Invoke(() =>
+ {
+ Closing -= ProctoringWindow_Closing;
+ closing?.Invoke();
+ base.Close();
+ });
+ }
+
+ public new void Hide()
+ {
+ Dispatcher.Invoke(base.Hide);
+ }
+
+ public void SetTitle(string title)
+ {
+ Dispatcher.Invoke(() => Title = title ?? "");
+ }
+
+ public new void Show()
+ {
+ Dispatcher.Invoke(base.Show);
+ }
+
+ public void Toggle()
+ {
+ Dispatcher.Invoke(() =>
+ {
+ if (Visibility == Visibility.Visible)
+ {
+ base.Hide();
+ }
+ else
+ {
+ base.Show();
+ }
+ });
+ }
+
+ private void InitializeWindow(IProctoringControl control)
+ {
+ if (control is UIElement element)
+ {
+ Content = element;
+ control.FullScreenChanged += Control_FullScreenChanged;
+ }
+
+ Closing += ProctoringWindow_Closing;
+ Loaded += ProctoringWindow_Loaded;
+ Top = SystemParameters.WorkArea.Height - Height - 15;
+ Left = SystemParameters.WorkArea.Width - Width - 20;
+ }
+
+ private void Control_FullScreenChanged(bool fullScreen)
+ {
+ if (fullScreen)
+ {
+ WindowState = WindowState.Maximized;
+ WindowStyle = WindowStyle.None;
+ }
+ else
+ {
+ WindowState = WindowState.Normal;
+ WindowStyle = WindowStyle.ToolWindow;
+ }
+ }
+
+ private void ProctoringWindow_Closing(object sender, CancelEventArgs e)
+ {
+ e.Cancel = true;
+ }
+
+ private void ProctoringWindow_Loaded(object sender, RoutedEventArgs e)
+ {
+ this.HideCloseButton();
+ }
+ }
+}