added something little, not that very important tho

This commit is contained in:
Lars
2020-10-22 17:46:45 +02:00
parent eae05d17df
commit 242c435ac7
2 changed files with 3 additions and 1 deletions

View File

@@ -23,7 +23,7 @@
<Label Grid.Row="2" FontSize="15" Content="(max amount of characters for the username is 10)"/> <Label Grid.Row="2" FontSize="15" Content="(max amount of characters for the username is 10)"/>
<TextBox Name="usernameTextbox" Grid.Row="1" Grid.Column="1" MaxLength="10" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Left" Width="250"/> <TextBox Name="usernameTextbox" Grid.Row="1" Grid.Column="1" MaxLength="10" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Left" Width="250"/>
<Button Content="ENTER" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="100" Height="40" Click="Button_EnterUsername"/> <Button Name="loginButton" Content="ENTER" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="100" Height="40" Click="Button_EnterUsername"/>
</Grid> </Grid>
</Window> </Window>

View File

@@ -28,6 +28,7 @@ namespace Client.Views
{ {
User user = new User(usernameTextbox.Text); User user = new User(usernameTextbox.Text);
Client client = new Client(user.Username); Client client = new Client(user.Username);
loginButton.IsEnabled = false;
client.OnSuccessfullConnect = () => client.OnSuccessfullConnect = () =>
{ {
// because we need to start the main window on a UI thread, we need to let the dispatcher handle it, which will execute the code on the ui thread // because we need to start the main window on a UI thread, we need to let the dispatcher handle it, which will execute the code on the ui thread
@@ -41,6 +42,7 @@ namespace Client.Views
}); });
}; };
} }
} }
} }