using Avalonia.Controls;
using Avalonia.Input;
using ClaudeDo.Ui.ViewModels.Planning;

namespace ClaudeDo.Ui.Views.Planning;

public partial class ConflictResolutionView : Window
{
    public ConflictResolutionView()
    {
        InitializeComponent();
    }

    protected override void OnDataContextChanged(EventArgs e)
    {
        base.OnDataContextChanged(e);
        if (DataContext is ConflictResolutionViewModel vm)
            vm.CloseRequested = Close;
    }

    private void TitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
    {
        if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
            BeginMoveDrag(e);
    }
}
