在 Silverlight 中创建可重用控件模板的最佳实践是什么

发布于 2024-07-09 03:47:19 字数 231 浏览 7 评论 0原文

创建可重复使用的控件模板的最佳实践是什么。

例如。 我想从标准复选框开始,并修改其模板以便在未来的多个项目中重复使用。

我了解如何在 Blend 中修改模板,但它总是希望将模板保存到当前项目的 App.xaml 或我首先放置复选框的父控件。

理想情况下,我想要一些包含我所有自定义控件和自定义模板(现有控件的修改模板)的 ControlLibrary 软件

-Jeff

What is the best practice for creating re-usable control templates.

For example. I want to start with the standard checkbox and modify its template for re-use accross multiple future projects.

I understand how to modify the template in Blend, but it always wants to save the template to App.xaml of the current project or to the parent control where I first placed the checkbox.

Ideally I would like some soft of ControlLibrary that contains all my custom controls AND custom templates (modified templates of existing controls)

-Jeff

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

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

发布评论

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

评论(2

最美不过初阳 2024-07-16 03:47:19

隐式样式管理器可能会有所帮助。

Silverlight 控件团队和其他人最近发表了一些有关 ISM 的博客,它允许将替代样式集全面应用于标准控件。 尝试 Jesse Liberty 的博客Mehdi Slaoui Andaloussi 的博客

华泰

Implicit Style Manager might be helpful.

The Silverlight controls team and others have been blogging a bit recently about ISM which allows alternative style sets to be applied across the board to standard controls. Try Jesse Liberty's blog or Mehdi Slaoui Andaloussi's blog

HTH

反差帅 2024-07-16 03:47:19

我认为您不能将 ControlTemplate 作为单独的实体而不附加到控件。 对于您的控件库,您可以创建具有适当自定义模板的自定义控件并重用这些控件。

I don't think you can have a ControlTemplate as a separate entity, without it being attached to a Control. For your control library you can create custom controls that have the appropriate custom templates and reuse the controls.

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