namespace XGame.Framework.UI.View
{
    public abstract class UIControllerBase<TViewModel> : IUIController, IUIContextSetter, IUIViewModelSetter where TViewModel : class, IUIViewModel
    {

        private UIContext _context;
        public UIContext Context => _context;
        UIContext IUIContextSetter.Context { set => _context = value; }

        private IUIViewModel _viewModel;
        protected TViewModel VM => _viewModel as TViewModel;

        IUIViewModel IUIViewModelSetter.ViewModel { set => _viewModel = value; }

        public abstract void OnEnable(object intent);
        public abstract void OnDisable();
    }
}
