using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace K11_CNC.ViewModel
{
    public partial class Motor : INotifyPropertyChanged
    {
        public string posX = "-----";
        private string posY = "-----";

        public event PropertyChangedEventHandler? PropertyChanged;

        public Motor()
        {
        //    //InitializeComponents();
        //    this.DataContext = this;
        //   DataContext mot;
        //    mot = (Motor)this.TryFindResource("vm");
        }
        //private void NotifyPropChange(String Info = "")
        //{
        //    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(Info));
        //}

        public string PosX
        {
            get { return posX; }
            set
            {
                posX = value;
                //NotifyPropChange("PosX");
                //SetProperty<string>(ref posX, value);
                OnPropertyChanged();
            }
        }
        public string PosY
        {
            get { return posY; }
            set
            {
                posY = value;
                //NotifyPropChange("PosY");
                //SetProperty(ref posY, value);
                OnPropertyChanged();
            }
        }
        private void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
