[ADDED] other canvas can be reset via an other canvas
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<Label Name="GuessWord" Grid.Row="0" Grid.Column="2" Content="{Binding Path=RandomWord, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20"/>
|
||||
|
||||
<Button Name="CanvasReset" Click="CanvasReset_Click" Grid.Row="0" Grid.Column="3" Content="RESET"/>
|
||||
<Button Name="CanvasReset" Command="{Binding ButtonResetCanvas}" Grid.Row="0" Grid.Column="3" Content="RESET"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user