using Avalonia.Controls; using Avalonia.Interactivity; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.InteropServices.JavaScript; namespace TovarV2 { public partial class MainWindow : Window { public List products = new List(); public TextBox CodeInputBox => CodeInput; public const string codeAdm = "0", codeUs = "1"; public static bool IsOpen { get; private set; } public MainWindow() { InitializeComponent(); this.Opened += (_, _) => IsOpen = true; this.Closed += (_, _) => IsOpen = false; } public void BtnVhod_OnClick(object? sender, RoutedEventArgs e) { string code = CodeInput.Text; if (code == "0") { ListPr.codeUser = 0; ProductEdit productEdit = new ProductEdit(); productEdit.Show(); } else if (code == "1") { ListPr.codeUser = 1; ProductEdit productEdit = new ProductEdit(); productEdit.Show(); } this.Close(); } } }