带有 UltraDockWorkspace 的 CAB
我在我的应用程序中使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试实现
IBuilderAware
接口并从OnBuiltUp
方法调用 AddViews 方法。在 Workspace 集合初始化后,CAB 将调用此方法。You can try implementing the
IBuilderAware
interface and call your AddViews method from theOnBuiltUp
method. This method will be called by CAB at a point after the Workspace collection is initialised.