1

This is a question relating to Microsoft Surface development, but I think it's more of a general WPF question as well.

How would I translate the following code, which I've found in an example:

<s:ScatterView>
    <s:ScatterViewItem Style="{DynamicResource FlippingScatterViewItemStyle}">
        // etc.
    </s:ScatterViewItem>
</s:ScatterView>

to work with data binding:

<s:ScatterView>
    <s:ScatterView.ItemTemplate>
        <DataTemplate>
            // etc.
        </DataTemplate>
    </s:ScatterView.ItemTemplate>
</s:ScatterView>

I'm not sure how to "attach" the Style declaration in the original code.

Apologies if my terminology is not correct, as I am a WPF newbie.

alexantd
  • 3,543
  • 3
  • 27
  • 41

1 Answers1

1

I'm not familiar with the ScatterView control but if it derives from ItemsControl which the ItemTemplate property suggests, then there should be an ItemContainerStyle property as well. The ItemContainerStyle is a style that is applied to the item itself.

<s:ScatterView ItemContainerStyle="{DynamicResource FlippingScatterViewItemStyle}">
    <s:ScatterView.ItemTemplate>
        <DataTemplate>
            // etc.
        </DataTemplate>
    </s:ScatterView.ItemTemplate>
</s:ScatterView>
Josh
  • 68,005
  • 14
  • 144
  • 156