using Avalonia.Controls; using Avalonia.Interactivity; namespace DemoService { public partial class MainWindow : Window { private readonly string adminCode = "0000"; public MainWindow() { InitializeComponent(); Background = Colors.white; UserButton.Background = Colors.orange; PasswordError.Foreground = Colors.white; AdminButton.Background = Colors.orange; } public void UserLogIn(object sender, RoutedEventArgs args) { ServiceWindow serviceWindow = new(false); serviceWindow.Show(); Close(); } public void AdminLogIn(object sender, RoutedEventArgs args) { if (PasswordCheck(Password.Text)) { ServiceWindow serviceWindow = new(true); serviceWindow.Show(); Close(); } else { PasswordError.Foreground = Colors.red; } } public bool PasswordCheck(string? password) { if (password == adminCode) { return true; } else { return false; } } } }