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

[WASM] Content for Templated Expander shows only once #19572

Open
ajpinedam opened this issue Feb 21, 2025 · 0 comments
Open

[WASM] Content for Templated Expander shows only once #19572

ajpinedam opened this issue Feb 21, 2025 · 0 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@ajpinedam
Copy link
Contributor

Current behavior

When using a Templated Expander, the Expander.Content shows only the first time it is opened. After this, when opening the Content, it shows empty.

uno_platform_expander_templated.mp4

Expected behavior

The content is visible all the time.

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

<Grid>
	<local:SettingsExpander Header="Hello From Header in Custom Control" IsExpanded="False">
		<local:SettingsExpander.Template>
			<ControlTemplate TargetType="local:SettingsExpander">
				<controls:Expander
				x:Name="PART_Expander"
				MinWidth="{TemplateBinding MinWidth}"
				MinHeight="{TemplateBinding MinHeight}"
				HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
				HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
				CornerRadius="{TemplateBinding CornerRadius}"
				IsExpanded="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
					<controls:Expander.Header>
						<Border Background="Purple">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<TextBlock
								x:Name="PPT_TextBlock"
								FontFamily="{TemplateBinding FontFamily}"
								FontSize="28"
								Foreground="Red"
								Text="{TemplateBinding Header}" />
								<TextBlock
								Grid.Row="1"
								FontFamily="{TemplateBinding FontFamily}"
								FontSize="14"
								Foreground="White"
								Text="On the Header" />
							</Grid>
						</Border>
					</controls:Expander.Header>
					<controls:Expander.Content>
						<Border Background="Gray">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<TextBlock
								x:Name="PPT_TextBlock2"
								FontFamily="{TemplateBinding FontFamily}"
								FontSize="28"
								Foreground="Red"
								Text="{TemplateBinding Header}" />
								<TextBlock
								Grid.Row="1"
								FontFamily="{TemplateBinding FontFamily}"
								FontSize="14"
								Foreground="White"
								Text="On the Content" />
							</Grid>
						</Border>
					</controls:Expander.Content>
				</controls:Expander>
			</ControlTemplate>
		</local:SettingsExpander.Template>
	</local:SettingsExpander>
</Grid>

Workaround

N/A

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

No response

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@ajpinedam ajpinedam added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant