using System;
using Avalonia.Controls;

namespace ClaudeDo.Ui.Views.MissionControl;

public partial class TaskMonitorWindow : Window
{
    public TaskMonitorWindow() => InitializeComponent();

    protected override void OnOpened(EventArgs e)
    {
        base.OnOpened(e);
        if (DataContext is ClaudeDo.Ui.ViewModels.Islands.TaskMonitorViewModel vm)
            vm.CloseWindowRequested = Close;
    }

    protected override void OnClosed(EventArgs e)
    {
        if (DataContext is ClaudeDo.Ui.ViewModels.Islands.TaskMonitorViewModel vm)
            vm.CloseWindowRequested = null;
        base.OnClosed(e);
    }
}
