added dialogue window if the user makes an unexpected / wrong input.
This commit is contained in:
parent
c730724262
commit
3142183cee
@ -39,7 +39,11 @@ public partial class NewLogin : Window
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Master Login Creation Failed");
|
||||
NewLoginUsernameBox.Text = string.Empty;
|
||||
NewLoginPasswordBox.Text = string.Empty;
|
||||
NewLoginEmailBox.Text = string.Empty;
|
||||
var ShowPopup = new PopUp();
|
||||
ShowPopup.ShowDialog(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
Project.View/PopUp/PopUp.axaml
Normal file
22
Project.View/PopUp/PopUp.axaml
Normal file
@ -0,0 +1,22 @@
|
||||
<Window
|
||||
Height="250"
|
||||
Title="WARNING"
|
||||
Width="500"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
x:Class="Project.View.PopUp"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<StackPanel Margin="20" Spacing="10">
|
||||
<TextBlock HorizontalAlignment="Center" Text="One or more of your inputs are missing or wrong." />
|
||||
<TextBlock HorizontalAlignment="Center" Text="All fields must be filled." />
|
||||
<TextBlock HorizontalAlignment="Center" Text="Your username needs at least 4 characters." />
|
||||
<TextBlock HorizontalAlignment="Center" Text="Your password needs at least 8 characters." />
|
||||
<TextBlock HorizontalAlignment="Center" Text="Make sure your email is correct." />
|
||||
<Button
|
||||
Click="OkButton_Click"
|
||||
Content="OK"
|
||||
HorizontalAlignment="Center"
|
||||
Width="80" />
|
||||
</StackPanel>
|
||||
</Window>
|
||||
21
Project.View/PopUp/PopUp.axaml.cs
Normal file
21
Project.View/PopUp/PopUp.axaml.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Media;
|
||||
using Project.Controller;
|
||||
using Project.Model;
|
||||
using Project.Persistence;
|
||||
|
||||
namespace Project.View;
|
||||
|
||||
public partial class PopUp : Window
|
||||
{ public PopUp()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OkButton_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user