Beispiel #1
0
        public void AddTabPage <T>(string text, Control view)
        {
            Debug.Assert(view != null, "view为null");

            Type tType = typeof(T);
            TypeBinderTabPage tabPage = new TypeBinderTabPage(text, tType, view);

            _tabPages.Add(tType, tabPage);

            _tabControl.TabPages.Add(tabPage);
        }
Beispiel #2
0
        void _tabControl_Selected(object sender, TabControlEventArgs e)
        {
            if (e.Action == TabControlAction.Selected)
            {
                if (TabPageChanged != null)
                {
                    TypeBinderTabPage tabPage = (TypeBinderTabPage)e.TabPage;

                    TabControlControllerEventArgs args = new TabControlControllerEventArgs(tabPage.BoundType, tabPage.View);
                    TabPageChanged(args);
                }
            }
        }