diff --git a/Scrabble/Scrabble.csproj b/Scrabble/Scrabble.csproj
index 84d74fe..5c1e4c2 100644
--- a/Scrabble/Scrabble.csproj
+++ b/Scrabble/Scrabble.csproj
@@ -80,8 +80,11 @@
BlankTileForm.xaml
-
- HelpWindow.xaml
+
+ MobileHelpWindow.xaml
+
+
+ DesktopHelpWindow.xaml
TextWindow.xaml
@@ -101,7 +104,11 @@
Designer
MSBuild:Compile
-
+
+ MSBuild:Compile
+ Designer
+
+
Designer
MSBuild:Compile
diff --git a/Scrabble/View/HelpWindow.xaml b/Scrabble/View/DesktopHelpWindow.xaml
similarity index 95%
rename from Scrabble/View/HelpWindow.xaml
rename to Scrabble/View/DesktopHelpWindow.xaml
index 2639174..e2e03ac 100644
--- a/Scrabble/View/HelpWindow.xaml
+++ b/Scrabble/View/DesktopHelpWindow.xaml
@@ -1,4 +1,4 @@
-
diff --git a/Scrabble/View/DesktopWindow.xaml.cs b/Scrabble/View/DesktopWindow.xaml.cs
index 27a68a2..1fcba54 100644
--- a/Scrabble/View/DesktopWindow.xaml.cs
+++ b/Scrabble/View/DesktopWindow.xaml.cs
@@ -8,6 +8,9 @@
using Scrabble.Model;
using Scrabble.Controller;
using Scrabble.Model.Game;
+using System.Linq;
+using System.Diagnostics;
+
namespace Scrabble
{
@@ -25,6 +28,7 @@ public DesktopWindow(int P, Game g)
{
InitializeComponent();
ThisPlayer = P;
+ this.Topmost= false;
game = g;
game.Subs(this);
GameState.GSInstance.OnStateChanged += OnStateChanged;
@@ -378,10 +382,32 @@ private void Window_KeyDown(object sender, KeyEventArgs e)
}
}
- private void HelpButton_Click(object sender, RoutedEventArgs e)
+ private async void HelpButton_Click(object sender, RoutedEventArgs e)
{
- HelpWindow hw = new HelpWindow();
- hw.ShowDialog();
+ bool isfound = false;
+ foreach (var item in Application.Current.Windows)
+ {
+ Debug.WriteLine(item.GetType());
+ if (item.GetType()==typeof(DesktopHelpWindow))
+ {
+ ((DesktopHelpWindow)item).Top = (System.Windows.SystemParameters.WorkArea.Height / 2)-(((DesktopHelpWindow)item).Height/2);
+ ((DesktopHelpWindow)item).Left = (System.Windows.SystemParameters.WorkArea.Width / 2) - (((DesktopHelpWindow)item).Width / 2);
+ ((DesktopHelpWindow)item).Topmost=false;
+ ((DesktopHelpWindow)item).Topmost = true;
+ return;
+ }
+ }
+ if (!isfound)
+ {
+ DesktopHelpWindow hw = new DesktopHelpWindow();
+ hw.Show();
+ }
+
+
+
+
+
}
+
}
}
diff --git a/Scrabble/View/HelpWindow.xaml.cs b/Scrabble/View/HelpWindow.xaml.cs
deleted file mode 100644
index 50942d2..0000000
--- a/Scrabble/View/HelpWindow.xaml.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Windows;
-
-namespace Scrabble.View
-{
- public partial class HelpWindow : Window
- {
- public HelpWindow()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Scrabble/View/MobileHelpWindow.xaml b/Scrabble/View/MobileHelpWindow.xaml
new file mode 100644
index 0000000..34efcad
--- /dev/null
+++ b/Scrabble/View/MobileHelpWindow.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/Scrabble/View/MobileHelpWindow.xaml.cs b/Scrabble/View/MobileHelpWindow.xaml.cs
new file mode 100644
index 0000000..41a698e
--- /dev/null
+++ b/Scrabble/View/MobileHelpWindow.xaml.cs
@@ -0,0 +1,14 @@
+using System.Windows;
+
+namespace Scrabble.View
+{
+ public partial class MobileHelpWindow : Window
+ {
+ public MobileHelpWindow()
+ {
+ InitializeComponent();
+ WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
+ Topmost = true;
+ }
+ }
+}
diff --git a/Scrabble/View/MobileWindow.xaml b/Scrabble/View/MobileWindow.xaml
index 610d0dc..fb45408 100644
--- a/Scrabble/View/MobileWindow.xaml
+++ b/Scrabble/View/MobileWindow.xaml
@@ -9,11 +9,14 @@
ResizeMode="CanMinimize"
>
-
-
-
-
-
+
+
+
+
+
+
+
+