带有 UltraDockWorkspace 的 CAB

发布于 2024-10-10 03:53:31 字数 2264 浏览 8 评论 0原文

我在我的应用程序中使用 CAB 和 SCSF,并且使用 Infragistics 的 CAB 可扩展性套件,

我遵循了这篇文章。该示例有三个项目。贝壳形态。 common 和 SmartPartLib

Infragistics CAB Extensibility Kit

在 SmartPartLib 项目中有类 ModuleController 。CS。此方法正在创建一些将在应用程序启动时显示的视图...我想知道何时

this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace]

初始化。我尝试在示例 SCSF 项目中执行相同操作,但我将此 WorkspaceObject 设为 null。请告诉我是否有人使用 Infragistics CAB Kit...

 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);

        }

I am using CAB and SCSF for my application and i am using CAB Extensibility Kit from Infragistics

I followed this article. The sample has three projects. Shell form . common and SmartPartLib

Infragistics CAB Extensibility Kit

in SmartPartLib project there is class ModuleController.cs. This method is creating some Views which are going to be displayed on App start... I want to know that when

this.WorkItem.Workspaces[Constants.WorkspaceNames.DockWorkspace]

is Initialized. I tried to do the same in sample SCSF project but i am getting this WorkspaceObject as null.. Please tell me is anyone using Infragistics CAB Kit...

 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);

        }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多孤肩上扛 2024-10-17 03:53:31

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

You can try implementing the IBuilderAware interface and call your AddViews method from the OnBuiltUp method. This method will be called by CAB at a point after the Workspace collection is initialised.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文