-
Notifications
You must be signed in to change notification settings - Fork 785
Closed as not planned
Closed as not planned
Copy link
Labels
needs-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)no-issue-activity
Description
I'm not sure if it's a bug or I'm doing something wrong. In order to reproduce it you will need source code: https://github.com/aosyatnik/UWP_ElementNameBinding_Issue
Steps to reproduce:
- Build and run the app. You will see a list of 10 numbers and "Redraw" button.
- Click on "Redraw" button. See, that the whole list is updated at once.
- Go to
\Themes\Generic.xamland 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
EntranceThemeTransitionand 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.
Question:
Why binding of IsStaggeringEnabled is not working? IsStaggeringEnabled is presented in MainViewModel and set to true. The view model is bind to UI and I can see a collection of numbers, so the view model is working.
Stackoverflow:
I also asked on stackoverflow, but people are suggesting to use x:Bind, but I can not do it, because it's templated control, do I?
Possible duplicate of #560 .
Metadata
Metadata
Assignees
Labels
needs-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)no-issue-activity