可用的 Prism 区域控件

发布于 2024-08-04 04:28:36 字数 268 浏览 2 评论 0原文

我是 Prism 的新手,我倾向于按照我看到的示例进行操作;将区域放置在 ItemsControl 中。我读到可以使用更多控件来定义区域,但不是全部。然而,我还没有看到关于哪些控件可以用来定义 Prism 区域,哪些控件不能用来定义 Prism 区域的概述。有规则或清单吗?

<ItemsControl x:Name="MainRegion" Regions:RegionManager.RegionName="MainRegion" />

I'm new to Prism, and I tend to just do as in the samples I see; place the Regions inside an ItemsControl. I have read that more controls can be used for defining region, but not all. However, I haven't seen an overview on what controls can be used to define Prism regions and not. Is there a rule or a list to it?

<ItemsControl x:Name="MainRegion" Regions:RegionManager.RegionName="MainRegion" />

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

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

发布评论

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

评论(1

不甘平庸 2024-08-11 04:28:36

此内容来自复合应用程序库中的“UI 组合”文档 :

复合应用程序库提供
以下区域适配器:
ContentControlRegionAdapter
SelectorRegionAdapter,以及
ItemsControlRegionAdapter。这些
适配器旨在适应控件
派生自 ContentControl
选择器ItemsControl
分别。还有一个额外的
适配器,TabControlRegionAdapter,使用
在 Silverlight 中,因为 Tab 控件
不是从 Selector 派生的,如下所示
WPF。

因此,简而言之,这些适配器适用于从这些受支持的容器派生的任何控件。例如,TabControl 继承自Selector

这显然还不是极限。如果您有一个不是从这些控件之一继承的自定义控件,则可以实现您自己的区域适配器来支持该控件。

希望这有帮助,
安德森

This is from the documentation for "UI Composition" in the Composite Application Library:

Composite Application Library provides
the following region adapters:
ContentControlRegionAdapter,
SelectorRegionAdapter, and
ItemsControlRegionAdapter. These
adapters are meant to adapt controls
derived from ContentControl,
Selector, and ItemsControl,
respectively. There is an additional
adapter, TabControlRegionAdapter, used
in Silverlight because the Tab control
does not derive from Selector as in
WPF.

So, the game here in a nutshell is that these adapters work for any control that derives from these supported containers. For example, a TabControl inherits from Selector.

This is obviously not the limit. If you have a custom control that doesn't inherit from one of these controls, you can implement your own Region Adapter to support that control.

Hope this helps,
Anderson

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