UWP VisualStateManager Adaptive Triggers don’t work inside Data Template

Issue

VisualStateManager Adaptive Triggers do not work when placed inside a ListView Data Template.

Resolution

The issue was resolved by wrapping DateTemplate content inside <UserControl>, something like this:

 

 


<Page.Resources>
<DataTemplate x:Key="UserListDataTemplate" x:DataType="data:User">
<UserControl>
<RelativePanel>
<VisualStateManager.VisualStateGroups>
......
</VisualStateManager.VisualStateGroups>
</RelativePanel>
</UserControl>
</DataTemplate>
</Page.Resources>

Visual Studio 2015
Universal Windows Platform
C#
January 2016

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *