YTImportWindow.axaml.cs 553 B

12345678910111213141516171819
  1. using Avalonia.Controls;
  2. namespace SlamCross.Views;
  3. public partial class YTImportWindow : Window
  4. {
  5. public string? ResultUrl { get; private set; }
  6. public YTImportWindow() => InitializeComponent();
  7. private void OK_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
  8. {
  9. var text = this.FindControl<TextBox>("UrlBox")?.Text?.Trim();
  10. if (!string.IsNullOrEmpty(text)) ResultUrl = text;
  11. Close();
  12. }
  13. private void Cancel_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e) => Close();
  14. }