Develop #10
@@ -14,7 +14,7 @@ namespace ClientApp.ViewModels
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public ICommand LoginCommand { get; set; }
|
||||
public bool LoginStatus { get; set; }
|
||||
public bool InvertedLoginStatus { get; set; }
|
||||
private MainWindowViewModel mainWindowViewModel;
|
||||
public LoginViewModel(MainWindowViewModel mainWindowViewModel)
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace ClientApp.ViewModels
|
||||
internal void setLoginStatus(bool status)
|
||||
{
|
||||
this.mainWindowViewModel.InfoModel.ConnectedToServer = status;
|
||||
this.LoginStatus = status;
|
||||
this.InvertedLoginStatus = !status;
|
||||
if (status)
|
||||
{
|
||||
this.mainWindowViewModel.SelectedViewModel = new MainViewModel(mainWindowViewModel);
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
<Label Content="Password" HorizontalContentAlignment="Center"/>
|
||||
<PasswordBox x:Name="Password" Width="120"/>
|
||||
<Button x:Name="Login" Content="Login" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=Password}" Margin="0,20,0,0" Width="120"/>
|
||||
<CheckBox Name = "PCheckBox" Margin = "198,94,208,194" Content = "Checked Me"/>
|
||||
<Popup IsOpen="{Binding LoginStatus}" PopupAnimation = "Slide">
|
||||
<Label Content="Login failed" Foreground="Red"/>
|
||||
<Popup IsOpen="{Binding InvertedLoginStatus}" PopupAnimation = "Fade" HorizontalAlignment="Left">
|
||||
<Label Content="Login failed" Foreground="Red" Background="#FFFF" />
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
|
||||
Reference in New Issue
Block a user