예제 #1
0
        public TvControl(ISkin skin, IViewport viewport, TState initialState, string name = null)
        {
            _component = new TvComponent <TState>(initialState, name ?? $"TvControl_<$>");
            Metadata   = new TvControlMetadata(this, _component.ComponentId);
            var typename   = GetType().Name.ToLowerInvariant();
            var genericIdx = typename.IndexOf('`');

            ControlType  = genericIdx != -1 ? typename.Substring(0, genericIdx) : typename;
            CurrentStyle = skin.GetControlStyle(this);
            State        = initialState;
            _component.AddViewport(viewport);
            AddElements();
        }