Skip to content

Commit

Permalink
fix: Properly apply template during measure after Loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed May 31, 2024
1 parent 3c45797 commit e8bfc59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Uno.UI/UI/Xaml/Controls/Control/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,12 @@ private void OnTemplateChanged(DependencyPropertyChangedEventArgs e)
internal void SetUpdateControlTemplate(bool forceUpdate = false)
{
if (
!FeatureConfiguration.Control.UseLegacyLazyApplyTemplate
|| forceUpdate
|| this.HasParent()
|| CanCreateTemplateWithoutParent
#if !UNO_HAS_ENHANCED_LIFECYCLE
!FeatureConfiguration.Control.UseLegacyLazyApplyTemplate ||
#endif
forceUpdate ||
this.HasParent() ||
CanCreateTemplateWithoutParent
)
{
UpdateTemplate();
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/FrameworkElement.Layout.crossruntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void InnerMeasureCore(Size availableSize)
// TODO: BEGIN Uno specific
if (this is Control thisAsControl)
{
thisAsControl.TryCallOnApplyTemplate();
thisAsControl.ApplyTemplate();

// Update bindings to ensure resources defined
// in visual parents get applied.
Expand Down

0 comments on commit e8bfc59

Please sign in to comment.