using System.Windows.Input;
using Prism.Commands;
using Valg.Eva.Skanning.Scan.Presentation.MainWindow;
using Valg.EVA.Skanning.UserInterfaceElements;

namespace Valg.Eva.Skanning.Scan.Presentation.ScanInProgress
{
    public class BoxIsDeletedDuringScanViewModel : ViewModelBase, INotificationDuringScanningViewModel
    {
        private bool isButtonFocused;

        public BoxIsDeletedDuringScanViewModel()
        {
            StartNewScannCommand = new DelegateCommand(StartNewScan);
        }

        private void StartNewScan()
        {
            PublishEvent<SetReadyForAcceptingBarcodesEvent, SetReadyForAcceptingBarcodesEventArgs>(new SetReadyForAcceptingBarcodesEventArgs());
        }

        public bool ErrorIsResolved
        {
            get { return false; }
        }

        public bool IsButtonFocused
        {
            get { return isButtonFocused; }
            set
            {
                isButtonFocused = value;
                OnPropertyChanged();
            }
        }

        public void SetDefaultFocus()
        {
            DelayedFocusSetter.SetFocus(() => IsButtonFocused = true);
        }

        public string Title
        {
            get { return Valg.EVA.Skanning.Resources.Language.ScanLanguageString.Warning_CountingIsLockedOrDeleted_Title; }
        }

        public string InformationText
        {
            get { return Valg.EVA.Skanning.Resources.Language.ScanLanguageString.Warning_CountingIsLockedOrDeleted_Info; }
        }

        public string StartNewScannText
        {
            get { return Valg.EVA.Skanning.Resources.Language.ScanLanguageString.Warning_CountingIsLockedOrDeleted_CommandText; }
        }

        public ICommand StartNewScannCommand { get; private set; }
    }
}
