Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: ElementName binding doesn't work in EntranceThemeTransition #2054

Closed
aosyatnik opened this issue Mar 2, 2020 · 4 comments
Closed
Labels
needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) no-issue-activity

Comments

@aosyatnik
Copy link

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:

  1. Build and run the app. You will see a list of 10 numbers and "Redraw" button.
  2. Click on "Redraw" button. See, that the whole list is updated at once.
  3. 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>
  1. Comment the first EntranceThemeTransition and uncomment the second EntranceThemeTransition. 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>
  1. 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?

https://stackoverflow.com/questions/60207057/uwp-elementname-binding-doesnt-work-in-entrancethemetransition

Possible duplicate of #560 .

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Mar 2, 2020
@ranjeshj
Copy link
Contributor

ranjeshj commented Mar 2, 2020

Not quite sure if this related to #560. This seems to be specific to just element name bindings within a control template while the other is about reaching out of the data template in an items control. @MikeHillberg @danzil Is this a known limitation of what can be done within a control template ?

@StephenLPeters StephenLPeters added team-Markup Issue for the Markup team team-Framework and removed team-Markup Issue for the Markup team needs-triage Issue needs to be triaged by the area owners labels Mar 3, 2020
@chrisglein chrisglein added needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) and removed question labels Mar 5, 2020
@chrisglein
Copy link
Member

Seems like it should work. We need someone to get it under a debugger and figure out why this isn't working.

@aosyatnik
Copy link
Author

Any updates on this? Is it a bug?

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) no-issue-activity
Projects
None yet
Development

No branches or pull requests

5 participants