From 398ba1d5bd5560c3bfddd54b5b14026288e9bf01 Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 23 Oct 2020 21:04:14 +0200 Subject: [PATCH] [ADDED] other canvas can be reset via an other canvas --- Client/ViewModels/ViewModelGame.cs | 8 ++++++-- Client/Views/GameWindow.xaml | 2 +- SharedClientServer/JSONConvert.cs | 9 +++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Client/ViewModels/ViewModelGame.cs b/Client/ViewModels/ViewModelGame.cs index d214565..4e7f042 100644 --- a/Client/ViewModels/ViewModelGame.cs +++ b/Client/ViewModels/ViewModelGame.cs @@ -100,7 +100,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()); } @@ -193,7 +193,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 @@