using System;
using System.Windows;
using TodoList.Services;
using TodoList.ViewModels;

namespace TodoList.Views
{
    public partial class QuickEntryWindow : Window
    {
        public QuickEntryWindow(IDataService dataService)
        {
            InitializeComponent();
            DataContext = new QuickEntryViewModel(dataService, () => this.Hide());
        }

        protected override void OnActivated(EventArgs e)
        {
            base.OnActivated(e);
            InputBox.Focus();
            InputBox.SelectAll();
        }
    }
}
