Skip to content

Conversation

@rmarinho
Copy link
Member

Description of Change

Handlers use the PresentedContent to get the content to renderer, but when the template changes nothing was calling a mapper that used that property.
Since there are some TemplateUtilities that run on ContentTemplateChange the order to call MapContent is important, it should be after all the TemplateUtilities logic run, so the best way without changing existing Controls code is on the ApplyTemplate

Issues Fixed

Fixes #4135

@rmarinho rmarinho requested review from PureWeen and hartez May 16, 2022 19:17
@jsuarezruiz jsuarezruiz added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 17, 2022
@rmarinho
Copy link
Member Author

Added the test @PureWeen

@rmarinho rmarinho requested a review from PureWeen May 18, 2022 18:28
protected override void OnApplyTemplate()
{
Handler?.UpdateValue(nameof(Content));
base.OnApplyTemplate();
Copy link
Member

Choose a reason for hiding this comment

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

Can we swap the order of these two?

I realize base.OnApplyTemplate is currently empty but it just feels like logically you'd want the UpdateValue call to happen after OnApplyTemplate

@PureWeen PureWeen merged commit 4a6fbfa into main May 26, 2022
@PureWeen PureWeen deleted the fix-4135 branch May 26, 2022 19:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.400 Look for this fix in 6.0.400! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

fixed-in-6.0.400 Look for this fix in 6.0.400! legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContentView: Setting the ControlTemplate dynamically causes the control to disappear

5 participants