using System;
using Avalonia.Controls;
using Avalonia.Interactivity;

namespace Minint.Views;

public partial class ContrastDialog : Window
{
    public double Factor => FactorSlider.Value;

    public ContrastDialog()
    {
        InitializeComponent();

        FactorSlider.PropertyChanged += (_, e) =>
        {
            if (e.Property == Slider.ValueProperty)
                FactorLabel.Text = FactorSlider.Value.ToString("F1");
        };

        OkButton.Click += (_, _) => Close(true);
        CancelButton.Click += (_, _) => Close(false);
    }
}
