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

Add an example of how to use use animated icon within a content control that is not the direct (logical) child. #4417

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

StephenLPeters
Copy link
Contributor

AnimatedIcon works by default if a templated content control sets the state property on the direct parent of the animated icon. However sometimes you have a content control and want to make the animated icon a (non-direct) descendent of the control. This adds an example of how you could do that with the current design.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 4, 2021
@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
controls:AnimatedIcon.State="{Binding (controls:AnimatedIcon.State), Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some comments here on how this is working and the wireup involved.

@@ -539,6 +640,18 @@
</Viewbox>
<TextBlock x:Name="LastTransitionTextBlock"/>
</StackPanel>

<StackPanel Background="Gray">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could move the style down into this StackPanel to keep the two together. its hard to know that the implicit button style about is what makes this scenario work.

@ranjeshj ranjeshj added area-AnimatedIcon team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 4, 2021
@StephenLPeters
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters merged commit d20fcb8 into master Mar 16, 2021
@StephenLPeters StephenLPeters deleted the user/stpete/AnimatedIconTwoWayBindingFailure branch March 16, 2021 00:45
@ghost
Copy link

ghost commented Apr 6, 2021

🎉Microsoft.UI.Xaml v2.6.0-prerelease.210405001 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AnimatedIcon team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants