using System.Windows;
using System.Windows.Input;

namespace PixiEditor.Views.Dialogs;

/// <summary>
///     Interaction logic for ResizeDocumentPopup.xaml
/// </summary>
internal partial class ResizeDocumentPopup : ResizeablePopup
{
    public ResizeDocumentPopup()
    {
        InitializeComponent();
        Owner = Application.Current.MainWindow;
        DataContext = this;
        Loaded += (_, _) => sizePicker.FocusWidthPicker();
    }

    private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
    {
        e.CanExecute = true;
    }

    private void CommandBinding_Executed_Close(object sender, ExecutedRoutedEventArgs e)
    {
        SystemCommands.CloseWindow(this);
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        DialogResult = true;
        Close();
    }
}
