首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带UltraDockWorkspace的CAB

带UltraDockWorkspace的CAB
EN

Stack Overflow用户
提问于 2011-01-05 20:27:07
回答 1查看 464关注 0票数 0

我正在为我的应用程序使用CAB和SCSF,并且我正在使用Infragistics的CAB可扩展性工具包

我关注了这篇文章。该示例包含三个项目。外壳形式。common和SmartPartLib

Infragistics CAB Extensibility Kit

在SmartPartLib项目中有ModuleController.cs类。这个方法是创建一些视图,这些视图将显示在App start上...我想知道什么时候

代码语言:javascript
复制
this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace]

已初始化。我试图在示例SCSF项目中执行相同的操作,但我得到的WorkspaceObject为null。请告诉我有没有人在用英格拉瑟斯出租车套件..。

代码语言:javascript
复制
 private void AddViews()
        {
            //Create the Root View first, but do not show it
            RootView theRootView = this.WorkItem.SmartParts.AddNew<RootView>();


            //Here is the important part: 
            //Whenever dynamically creating controls that will interact with the
            //UltraDockManager, for the best results, make sure that you
            //assign a unique value to the control's "Name" property. In this case,
            //since the dynamic nature of CAB and SmartParts brings us to the
            //same situation, we also add a value to the SmartPart's "Name" property:

            TreeView theTreeView = this.WorkItem.SmartParts.AddNew<TreeView>();                 //1: Create
            theTreeView.Name = "theTreeView";                                                   //2: Set Name
            this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace].Show(theTreeView); //3: Show it

            GridView theGridView = this.WorkItem.SmartParts.AddNew<GridView>();
            theGridView.Name = "theGridView";
            this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace].Show(theGridView);

            ChartView theChartView = this.WorkItem.SmartParts.AddNew<ChartView>();
            theChartView.Name = "theChartView";
            this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace].Show(theChartView);

            //Load the layout through the interface
            ((IRootView)theRootView).LoadDockLayout();

            //Finally show the Root View
            this.WorkItem.Workspaces[Constants.WorkspaceNames.MainWorkspace].Show(theRootView);

        }
EN

回答 1

Stack Overflow用户

发布于 2011-01-05 22:58:21

您可以尝试实现IBuilderAware接口,并从OnBuiltUp方法调用AddViews方法。此方法将由CAB在初始化Workspace集合后的某个点调用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4603968

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档