-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
TransitioningContentControl issue #13493
Comments
Okay, I just successfully created a repro for this issue: ! There are possible photosensitive epilepsy contents, and there is a 100ms fast page switching in the repro. https://github.com/laolarou726/TCCExceptionTest Download and build the repro, then click the |
It seems when I changing the content for a TCC that is inside another TCC will cause this issue. My repro has the similar structure. |
are you setting the content directly? Imo it would be much safer to use DataTemplates instead of setting the content directly. |
But in this case it's impossible to use the DataTemplate to replace the content setting right. I'm using the TCX as the NavigationFrame here. |
My current temporary solution is this: Rewrite the Theme of the TCC like this: <ControlTheme x:Key="{x:Type TransitioningContentControl}"
TargetType="TransitioningContentControl">
<!-- Set Defaults -->
<Setter Property="Template">
<ControlTemplate>
<Panel>
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
<ContentPresenter Name="PART_TransitionContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme> Then everything will work just fine except all the transition animations will be loss. But the page switch will be fine. |
Could be, yeah. If you test a release just before that PR was merged, is the issue resolved? I don't know what a proper solution would be. The TCC is kind of nightmare to me 😃 /cc @danielmayost |
Just created a PR to fix this issue, it should be good right now. #13518 |
Describe the bug
TCC will throw an exception when switch back to the old content:
Even I ensured control's Visual Parent is cleared:
I tried to write a repro but I failed to do so.
Expected behavior
Content should switch between old and new content.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: