0

I've got a UWP app that is built to be responsive using a combo of VisualStateTriggers, percentage GridColumn widths and some other code-behind techniques. Overall, from page to page, I've gotten layouts that dynamically resize nicely at different window sizes.

However on one page, I have a GridView that is bound to a list of data, using a DataTemplate to render each GridViewItem. On smaller screen sizes, I want to change how Items in the GridView are displayed pretty drastically.

All the examples I'm finding involve creating two DataTemplates and switching them based on screen size. Unfortunately, this technique only switches the DataTemplate on load when the data is bound, which causes issues if the user resizes the window.

I'd like to know the best approach for switching or altering a GridView DataTemplate based on screen size that will switch dynamically as the window is resizes by the user.

Wyetro
  • 8,439
  • 9
  • 46
  • 64
Scott
  • 1,011
  • 1
  • 15
  • 30

1 Answers1

0

This worked for me: AdaptiveTrigger and DataTemplate

VisualStateTriggers work in the DataTemplates, but you needed the wrap everything in a UserControl.

Community
  • 1
  • 1
Scott
  • 1,011
  • 1
  • 15
  • 30