简体   繁体   English

Silverlight 自定义控件

[英]Silverlight custom controls

are there good books on developing custom controls for silverlight?有没有关于为 silverlight 开发自定义控件的好书?

What I want is to create a grid-control that can also act as TreeList-control.我想要的是创建一个网格控件,它也可以充当 TreeList 控件。 Can you tell me what is a good base-class for such a control?你能告诉我这种控件的好的基类是什么吗?

And another question: If I develop a control in Silverlight, how can I reuse my code for the same controls as WPF?还有一个问题:如果我在 Silverlight 中开发一个控件,我怎样才能将我的代码重用于与 WPF 相同的控件?

Do have to duplicate the code?一定要复制代码吗? I hope not...我希望不是...

Bye Matthias再见马蒂亚斯

What I want is to create a grid-control that can also act as TreeList-control.我想要的是创建一个网格控件,它也可以充当 TreeList 控件。 Can you tell me what is a good base-class for such a control?你能告诉我这种控件的好的基类是什么吗?

Basically, it depends on several factor and you have more options.基本上,这取决于几个因素,你有更多的选择。 In my opinion, I would choose to go with Panel , incase if I need more control during layout and arrange process.在我看来,我会选择 go 和Panel ,以防我在布局和排列过程中需要更多控制。

Or else, you could simply extend from the ItemsControl and write you own control.或者,您可以简单地从 ItemsControl 扩展并编写您自己的控件。 But if you are planning for much bigger implementation, then I would highly suggest you to read the implementation of GridControl available in the WPF Toolkit .但是,如果您计划进行更大的实施,那么我强烈建议您阅读WPF Toolkit中提供的 GridControl 的实施。

Tree List Control On Code Project代码项目上的树列表控件

And another question: If I develop a control in Silverlight, how can I reuse my code for the same controls as WPF?还有一个问题:如果我在 Silverlight 中开发一个控件,我怎样才能将我的代码重用于与 WPF 相同的控件?

Sharing Code Between WPF and Silverlight From MSDN 在 WPF 和 Silverlight 之间共享代码来自 MSDN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM