using System.Windows.Controls;
using System.Windows.Input;
using ConeCalorimeter.ViewModels;

namespace ConeCalorimeter.Views;

public partial class ConeRadiationSettingsView : UserControl
{
    public ConeRadiationSettingsView()
    {
        InitializeComponent();
    }

    private void ConeParameterTextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
    {
        if (DataContext is ConeRadiationSettingsViewModel viewModel)
        {
            viewModel.BeginConeParameterEdit();
        }
    }

    private void ConeParameterTextBox_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
    {
        if (DataContext is ConeRadiationSettingsViewModel viewModel)
        {
            viewModel.EndConeParameterEdit();
        }
    }
}
