using System.Diagnostics.CodeAnalysis;
using System.Windows;

namespace Valg.EVA.Skanning.UserInterfaceElements.UserSettingWindow
{
    [ExcludeFromCodeCoverage]
    public partial class UserSettingWindow : IUserSettingWindow
    {
        private readonly IUserSettingWindowViewModel viewModel;

        public UserSettingWindow(IUserSettingWindowViewModel viewModel)
        {
            InitializeComponent();
            this.viewModel = viewModel;
            DataContext = this.viewModel;
        }

        public void ShowWindow()
        {
            ShowDialog();
        }

        public void AddAddtionalSettingsCommands(params AdditionalSettingCommand[] additionalSettingCommands)
        {
            foreach (var additionalSettingCommand in additionalSettingCommands)
            {
                viewModel.AdditionalSettings.Add(additionalSettingCommand);
            }
        }

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

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

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

