login failed popup shows
This commit is contained in:
@@ -14,7 +14,7 @@ namespace ClientApp.ViewModels
|
|||||||
{
|
{
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public ICommand LoginCommand { get; set; }
|
public ICommand LoginCommand { get; set; }
|
||||||
public bool LoginStatus { get; set; }
|
public bool InvertedLoginStatus { get; set; }
|
||||||
private MainWindowViewModel mainWindowViewModel;
|
private MainWindowViewModel mainWindowViewModel;
|
||||||
public LoginViewModel(MainWindowViewModel mainWindowViewModel)
|
public LoginViewModel(MainWindowViewModel mainWindowViewModel)
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ namespace ClientApp.ViewModels
|
|||||||
internal void setLoginStatus(bool status)
|
internal void setLoginStatus(bool status)
|
||||||
{
|
{
|
||||||
this.mainWindowViewModel.InfoModel.ConnectedToServer = status;
|
this.mainWindowViewModel.InfoModel.ConnectedToServer = status;
|
||||||
this.LoginStatus = status;
|
this.InvertedLoginStatus = !status;
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
this.mainWindowViewModel.SelectedViewModel = new MainViewModel(mainWindowViewModel);
|
this.mainWindowViewModel.SelectedViewModel = new MainViewModel(mainWindowViewModel);
|
||||||
|
|||||||
@@ -14,9 +14,8 @@
|
|||||||
<Label Content="Password" HorizontalContentAlignment="Center"/>
|
<Label Content="Password" HorizontalContentAlignment="Center"/>
|
||||||
<PasswordBox x:Name="Password" Width="120"/>
|
<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"/>
|
<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 InvertedLoginStatus}" PopupAnimation = "Fade" HorizontalAlignment="Left">
|
||||||
<Popup IsOpen="{Binding LoginStatus}" PopupAnimation = "Slide">
|
<Label Content="Login failed" Foreground="Red" Background="#FFFF" />
|
||||||
<Label Content="Login failed" Foreground="Red"/>
|
|
||||||
</Popup>
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user