Windows Embedded Silverlight 的 TabControl
我需要一个用于 Silverlight for Windows Embedded 应用程序的选项卡控件,我的任务是开发。它不是一个开箱即用的受支持的控件,因此我希望可以从头开始构建自定义控件。
作为 Silverlight 和 XAML 的新手,任何人都可以向我指出任何有用的教程/资源吗?
迄今为止我的搜索并没有多大用处。
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的最佳方法很大程度上取决于您实际需要选项卡控件执行的操作。如果您只需要一个看起来与默认值略有不同的选项卡控件,那么您最好的选择几乎肯定是重复使用现有的选项卡控件之一(例如,来自 Silverlight Toolkit),并修改其控件模板,使其看起来像您想要的那样。您还可以使用模板的副本来进行您需要的任何行为更改。
但是,即使您需要相当大的变化,而这种方式无法支持(如果是这种情况,我会感到非常惊讶,尽管发生了更奇怪的事情),我强烈建议仍然从选项卡控件开始Silverlight 工具包,并根据需要修改源代码。这比从头开始构建要简单得多。
有一个示例说明如何修改 Silverlight Toolkit 选项卡控件的模板 此处。
Your best approach very much depends on what you actually need the tab control to do. If you simply need a tab control that looks a little different from the default, your best bet is almost certainly to just re-use one of the existing tab controls (e.g., from the Silverlight Toolkit), and modify its control template to make it look like what you want. You may also be able to use your copy of the template to make any behavior changes you need as well.
But even if you need fairly dramatic changes that can't be supported in this fashion (I would be quite surprised if this were the case, though stranger things have happened), my strong recommendation would still be to start with the tab control from the Silverlight toolkit, and modify the source as necessary. It will be much simpler than building one from scratch.
There's an example of how to modify the template of the Silverlight Toolkit Tab Control here.