using MainShell.Hardware;
using MainShell.Recipe.Models;
using MainShell.Recipe.Services;
using Stylet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MainShell.Recipe.ViewModel
{
    public class SubstrateTeachViewModel : CameraBaseViewModel
    {

        private SubstrateRecipe _substrateRecipe;
        public SubstrateRecipe SubstrateRecipe
        {
            get { return _substrateRecipe; }
            set
            {
                if (SetAndNotify(ref _substrateRecipe, value))
                {
                    if (MarkTeachViewModel != null)
                    {
                        MarkTeachViewModel.SubstrateRecipe = value;
                    }
                }
            }
        }

        private MarkTeachViewModel _markTeachViewModel;
        public MarkTeachViewModel MarkTeachViewModel
        {
            get { return _markTeachViewModel; }
            set { SetAndNotify(ref _markTeachViewModel, value); }
        }

        private readonly HardwareManager _hardwareManager;
        private readonly IWindowManager _windowManager;
        public SubstrateTeachViewModel(HardwareManager hardwareManager, IWindowManager windowManager)
        {
            _hardwareManager = hardwareManager ?? throw new ArgumentNullException(nameof(hardwareManager));
            _windowManager = windowManager ?? throw new ArgumentNullException(nameof(windowManager));
            _cameraAxisViewModel = IoC.Get<Common.Display.ViewModel.CameraAxisViewModel>();
            MarkTeachViewModel = new MarkTeachViewModel(hardwareManager, _windowManager);
            _cameraAxisViewModel.CameraAxisDevices.HardwareDeviceList = hardwareManager.CameraAxisManager.TopCameraAxisDevices;
        }


    }
}
