This report demonstrates issue with Binding to ElementName.
- Build and run app. You will see list of 10 numbers and "Redraw" button.
- Click on "Redraw" button. See, that the whole list is updated at once.
- Go to
\Themes\Generic.xaml
and fine next code:
<TransitionCollection>
<!-- THIS BINDING IS NOT WORKING -->
<EntranceThemeTransition IsStaggeringEnabled="{Binding ElementName=Items, Path=DataContext.IsStaggeringEnabled}"
FromVerticalOffset="-20"
FromHorizontalOffset="-20" />
<!--<EntranceThemeTransition IsStaggeringEnabled="True"
FromVerticalOffset="-20"
FromHorizontalOffset="-20" />-->
</TransitionCollection>
- Comment the first
EntranceThemeTransition
and uncomment the secondEntranceThemeTransition
. Code should look like this:
<TransitionCollection>
<!-- THIS BINDING IS NOT WORKING -->
<!--<EntranceThemeTransition IsStaggeringEnabled="{Binding ElementName=Items, Path=DataContext.IsStaggeringEnabled}"
FromVerticalOffset="-20"
FromHorizontalOffset="-20" />-->
<EntranceThemeTransition IsStaggeringEnabled="True"
FromVerticalOffset="-20"
FromHorizontalOffset="-20" />
</TransitionCollection>
- Click on "Redraw" and see how each item is updated with animation one by one.
Why binding is not working?