When I set Items[2].IsAnimating = true, the third item in the ListView should start animating its border's background.
Actual behavior
The actual behavior is in line with expectations on PCs and phones running 10586 (November update) and 15063 (Creators Update). However, on 14393 (Anniversary Update) whichever item's IsAnimating property is set, the storyboard always runs on the first item in the list. In fact, stepping through the code it seems that each ControlStoryboardAction has set the first item's Storyboard, which it then manipulates.
Interesting thing to note is that compiling the app against different SDK versions has no effect. Whether the app's target SDK is NU, AU or CU, the results are always the same.
Workaround
The only workaround I have found so far is to wrap the contents of the DataTemplate into a UserControl (this approach is also demonstrated in the sample solution), which works consistently everywhere. Still it is a very strange problem and I think it warrants investigation (also because AU is currently the most widely used version of W10).
It looks like there's a change in behavior when dealing with Static Resources that are declared in the item template. Definitely curious, glad you found a work around.
While building a UWP app I have noticed a very unusual behavior with
ControlStoryboardAction
running on Anniversary Update PCs.Code sample
Download sample
You can download the sample solution here: AnimationInDataTemplateProblem.zip
Expected behavior
When I set
Items[2].IsAnimating = true
, the third item in theListView
should start animating its border's background.Actual behavior
The actual behavior is in line with expectations on PCs and phones running 10586 (November update) and 15063 (Creators Update). However, on 14393 (Anniversary Update) whichever item's
IsAnimating
property is set, the storyboard always runs on the first item in the list. In fact, stepping through the code it seems that eachControlStoryboardAction
has set the first item'sStoryboard
, which it then manipulates.Interesting thing to note is that compiling the app against different SDK versions has no effect. Whether the app's target SDK is NU, AU or CU, the results are always the same.
Workaround
The only workaround I have found so far is to wrap the contents of the
DataTemplate
into aUserControl
(this approach is also demonstrated in the sample solution), which works consistently everywhere. Still it is a very strange problem and I think it warrants investigation (also because AU is currently the most widely used version of W10).