diff --git a/Client/ViewModels/ViewModelGame.cs b/Client/ViewModels/ViewModelGame.cs
index b2f031a..2fe09c9 100644
--- a/Client/ViewModels/ViewModelGame.cs
+++ b/Client/ViewModels/ViewModelGame.cs
@@ -101,7 +101,7 @@ namespace Client.ViewModels
private void CanvasResetLocal()
{
this.window.CanvasForPaint.Children.Clear();
- data.Client.SendMessage(JSONConvert.GetMessageToSend(JSONConvert.CANVAS, JSONConvert.CANVAS_RESET));
+ data.Client.SendMessage(JSONConvert.ConstructCanvasReset());
}
@@ -194,7 +194,11 @@ namespace Client.ViewModels
private void CanvasResetData()
{
- this.window.CanvasForPaint.Children.Clear();
+ Application.Current.Dispatcher.Invoke(delegate
+ {
+ this.window.CanvasForPaint.Children.Clear();
+ });
+
}
private void ChatBox_KeyDown()
diff --git a/Client/Views/GameWindow.xaml b/Client/Views/GameWindow.xaml
index 0f1a0c7..1db2611 100644
--- a/Client/Views/GameWindow.xaml
+++ b/Client/Views/GameWindow.xaml
@@ -40,7 +40,7 @@
-
+
diff --git a/SharedClientServer/JSONConvert.cs b/SharedClientServer/JSONConvert.cs
index 129b3ba..82755e3 100644
--- a/SharedClientServer/JSONConvert.cs
+++ b/SharedClientServer/JSONConvert.cs
@@ -193,6 +193,15 @@ namespace SharedClientServer
color = colorToSend
});
}
+
+ public static byte[] ConstructCanvasReset()
+ {
+ dynamic payload = new
+ {
+ canvasType = CANVAS_RESET
+ };
+ return GetMessageToSend(CANVAS, payload);
+ }
public static int GetCanvasMessageType(byte[] json)
{