using System;
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.ClientBase
{
    public class BusyIndicateableUiViewModelBase : UiViewModelBase
    {
        #region Variables
        private bool _isBusy;
        private string _busyIndicatorMessage;
        #endregion
        #region Properties
        /// 
        /// 返回ViewModel绑定的视图对象。
        /// 
        public UserControl View { get; private set; }
        /// 
        /// 设置或返回忙信息。
        /// 
        public string BusyIndicatorContent
        {
            get => _busyIndicatorMessage;
            set
            {
                _busyIndicatorMessage = value;
                NotifyOfPropertyChange(nameof(BusyIndicatorContent));
            }
        }
        /// 
        /// 设置或返回视图是否正忙。
        /// 
        public bool IsBusy
        {
            get => _isBusy;
            set
            {
                _isBusy = value;
                NotifyOfPropertyChange(nameof(IsBusy));
            }
        }
        #endregion
        #region Methods
        protected override void OnViewLoaded(object _view)
        {
            base.OnViewLoaded(_view);
            View = (UserControl)_view;
        }
        /// 
        /// 取消操作。
        /// 
        /// 
        public virtual void Cancel()
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}