如何修改< phone:LongListSelector>中仅第一个元素的样式? [英] How to modify style of only very first element in <phone: LongListSelector>?
问题描述
我正在使用Windows Phone 8,并且有以下查询.
在将数据绑定到< phone:LongListSelector>时,我只想修改第一个元素的样式.
I am working on Windows Phone 8 and i have below query.
While binding data to a <phone: LongListSelector>, I want to modify style of only very first element.
Is there any way in XAML to handle such scenario?
推荐答案
您可以通过设置包含在数据绑定List中的相应类对象来任意修改视觉元素的样式,可见性等.包括其他属性,例如MyStyle,MyVisibility等,然后进行引用 xaml中的那些属性,例如{Binding MyStyle}.
You can arbitrarily modify the style, visibility, etc. of visual elements by setting up the corresponding class objects contained within the data bound List<> to include additional properties such MyStyle, MyVisibility etc. and then reference those properties in the xaml, such as {Binding MyStyle}.
或者,第一个元素实际上可能不是LongListSelector的成员.只需将其作为独立的可视元素放在LongListSelector上方(例如,作为父元素位于父级LongListSelector上方的兄弟姐妹). StackPanel)
Alternately the first element could actually not be a member of the LongListSelector. Just place it above the LongListSelector as a standalone visual element (for example as a sibling immediately above the LongListSelector within a parent StackPanel)
-希望这会有所帮助,
标记
-Hope this helps,
Mark
这篇关于如何修改< phone:LongListSelector>中仅第一个元素的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!