WPF:如何对列表或网格中的项目执行自定义渲染?

发布于 2024-07-24 05:53:17 字数 203 浏览 6 评论 0原文

使用 Adob​​e Flex,我将创建一个自定义 ItemRenderer 来更改网格中项目的显示。 这会执行一些覆盖网格控件呈现项目的方式的代码。 我如何使用 WPF 执行此操作? 可用技术对性能有何影响?

我的最初目标是显示一个图标、一个标题和一个描述。 理想情况下,描述应位于标题下方。 Vista TaskDialog 按钮使用类似的 UI。

With Adobe Flex I would create a custom ItemRenderer to change the display of items in a grid. This executes some code that overrides how the grid control renders items. How do I do this with WPF? What are the performance implications with the techniques available?

My initial aim is to display an icon, a title, and a description. Ideally the description would be under the title. A similar UI is used by the Vista TaskDialog buttons.

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

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

发布评论

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

评论(1

我不是你的备胎 2024-07-31 05:53:17

使用数据模板。 您可以将其设置为 ItemTemplate (ListBox)、CellTemplate (GridViewColumn)、HeaderTemplate 等。

性能取决于模板的复杂程度,但对于您所描述的内容,您不应该注意到差异。

Use Data Template. You can set it for ItemTemplate (ListBox), CellTemplate (GridViewColumn), HeaderTemplate, etc.

Performance depends on how complex the template is, but for what you described, you should not notice a difference.

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