tags:

views:

90

answers:

1

Can something like this be done through attributes or templates (pseudo xaml :))

<ListView ListViewItem.Style={x:Null}>
</ListView>

This question is not just about ListView, it's about all ItemsControl's classes, is there a way to set or reset style for item's from container.

A: 
<ListView ItemContainerStyle="{x:Null}"/>

Works for any ItemsControl:

<ListBox ItemContainerStyle="{StaticResource SomeStyle}"/>

HTH,
Kent

Kent Boogaart
Thanks for reply, i have tried this before, somehow it doesn't work. I am using WPF theme from codeplex, and it defines Style with ListViewItem as TargetType. If I insert in ListView something like this <ListViewItem Style="{x:Null}">...</ListViewItem> style ll be reseted (also i can reset style from code, but it doesn't feel right). I don't know why this happening, maybe i don't understand something about how styles work :(
Andrew
Thank's for the tip again :) Really strange behavior:<ListView ItemContainerStyle="{x:Null}"/> won't work, value mustn't be null, so:<ListView.ItemContainerStyle><Style></Style></ListView.ItemContainerStyle>Works just fine.
Andrew