You should be able to use WPF data binding to the Orientation property of the Wrap Panel.
You just need a property in your
DataContext
that provides the desired orientation.
<WrapPanel Orientation="{Binding Path=ListViewOrientation, FallbackValue=Horizontal}"
VerticalAlignment="Top" />
Here I called it
ListViewOrientation
. It really ought to be named something relative to
your problem/solution space. That it also affects the display of the ListView is an aside. ;-)
If you're going to be changing multiple properties of the template, you should look into a DataTemplateSelector to see if that does what you want.