[英]Why doesn't Silverlight's ItemsControl have an ItemContainerStyle property?
The title pretty much says it all. 标题基本概括了所有内容。 I can roll my own, but given WPF has it, it's conspicuous by its absence.
我可以自己动手,但是鉴于WPF拥有它,因此它的缺席是显而易见的。
I think exactly answered may only Silverlight developers, but they usually do not like to answer such questions. 我认为确切的答案可能只有Silverlight开发人员,但他们通常不喜欢回答此类问题。 Silverlight is much stripped down version of WPF, it is done because
MSDN
: Silverlight是WPF的简化版本,之所以如此是因为
MSDN
:
To keep
Silverlight
small and lightweight, some WPF and .NET Framework features are not available inSilverlight
.为了使
Silverlight
保持小巧轻便,Silverlight
中不提供某些WPF和.NET Framework功能。
Why is removed ItemContainerStyle
? 为什么要删除
ItemContainerStyle
? Probably thought he was there in ListBox, so as an alternative you can use ListBox.ItemContainerStyle
. 可能以为他在ListBox中,所以可以使用
ListBox.ItemContainerStyle
作为替代。
Although the developers could not just remove the ItemContainerStyle
property from ItemsControl class, because this property is not in ListBox WPF, he inherits is from Selector class and Selector from ItemsControl
like this: 尽管开发人员不能仅从ItemsControl类中删除
ItemContainerStyle
属性,但由于此属性不在ListBox WPF中,所以他继承自Selector类,并从ItemsControl
继承Selector,如下所示:
[Localizability(LocalizationCategory.ListBox)]
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(ListBoxItem))]
public class ListBox : Selector
{
...
}
This once again proves that it is a deliberate decision taken at the design stage of Silverlight. 这再次证明这是在Silverlight设计阶段做出的故意决定。
In fact, many things in Silverlight and in WPF are implemented differently. 实际上,Silverlight和WPF中的许多事情都是以不同的方式实现的。 Therefore, I advise you to see this links, but again, this is only a small (common) part of the difference:
因此,我建议您看一下此链接,但同样,这只是区别的一小部分(常见):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.