Skip to content

[WASM] SettingsExpander does not render correctly #17312

Closed

Description

@MartinZikmund

Current behavior

CommunityToolkit/Windows#393

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    triage/untriaged
    difficulty/tbd
    on Jun 26, 2024
  2. self-assigned this
    on Jul 22, 2024
  3. changed the title [-]`SettingsExpander` does not render correctly on WASM[/-] [+][WASM] `SettingsExpander` does not render correctly[/+] on Aug 13, 2024
  4. ajpinedam commented on Aug 14, 2024

    @ajpinedam
    Contributor

    We found the problem with this issue is connected to the Uno Expander Control.

    The SettingsExpander has the following Style Configuration (simplified version):

    <Expander>
        <Expander.Header>
            <SettingsCard />
        </Expander.Header>
        <Expander.Content>
            <ItemsControl />
        </Expander.Content>
    </Expander>

    When rendered, the SettingsCard is part of the Visual Tree, but the Data bound is not correct.

    The SettingsCard sets a TemplateBinding from the Expander.Header but due to an issue on the TemplatedParent Syncronization this is returning the wrong information.

    Expander Control Template Template (simplified version):

    <!-- Expander ControlTemplate -->
    <Grid>
        <RowDefinition x:Name="Row0" Height="Auto" />
        <RowDefinition x:Name="Row1" Height="*" />    
        <ToggleButton  Content="{TemplateBinding Header}" Style="{StaticResource ExpanderHeaderDownStyle}" />
        <Border>
            <ContentPresenter Content="{TemplateBinding Content}" Grid.Row="1" />
        </Border>
    </Grid>
    
    
    <!-- Expander Header Control Template (ExpanderHeaderDownStyle) -->
    <Grid>
         <ContentPresenter x:Name="ContentPresenter" />
    </Grid>

    As can be seen, the Header ContentPresenter is inside a ToggleButton. When calling the TemplatedParentSyncronization here, this returns a level dip in the UI tree.

    Specifically, in this line of code:

    return (this.TemplatedParent as IFrameworkElement)?.TemplatedParent;

    It's returning the Expander instead of the SettingsExpander

    We believe that @Xiaoy312 PR 17645 will fix this issue since this PR is fixing issues related to the TemplatedParent like this one.

  5. github-actions commented on May 8, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  6. locked as resolved and limited conversation to collaborators on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/tbdkind/bugtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions