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

[Windows][Material][ToggleButton] Using MaterialIconToggleButtonStyle without setting AlternateContent causes a crash when toggling #1132

Closed
kazo0 opened this issue Aug 3, 2023 · 2 comments · Fixed by #1137 or #1159
Assignees
Labels
kind/bug Something isn't working

Comments

@kazo0
Copy link
Collaborator

kazo0 commented Aug 3, 2023

WINDOWS ONLY

When using a ToggleButton with the style: MaterialIconToggleButtonStyle, if I do not set the um:ControlExtensions.AlternateContent, the app will crash when I attempt to toggle the button by clicking on it.

So the following XAML causes a crash:

<ToggleButton Style="{StaticResource MaterialIconToggleButtonStyle}">
	<ToggleButton.Content>
		<SymbolIcon Symbol="Accept" />
	</ToggleButton.Content>
</ToggleButton>

While the following XAML works fine:

<ToggleButton Style="{StaticResource MaterialIconToggleButtonStyle}">
	<ToggleButton.Content>
		<SymbolIcon Symbol="Accept" />
	</ToggleButton.Content>
	<um:ControlExtensions.AlternateContent>
		<SymbolIcon Symbol="Delete" />
	</um:ControlExtensions.AlternateContent>
</ToggleButton>

Repro app

UnoApp5.zip

@agneszitte
Copy link
Contributor

Re-Open for Backport PR

@trydalch
Copy link

trydalch commented Sep 22, 2024

I'm running into a related issue here.

I don't need to use the alternate content, and would like the Content to not be hidden when I toggle the button. Is there a way to only hide the Content if AlternateContent is set?

This seems more in line with the WinUI ToggleButton behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment