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

fix: Fix AlternateContent for ToogleButton crashing on UWP when not set #1137

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
<!-- Alternate Content -->
<ContentPresenter x:Name="AlternateContentPresenter"
AutomationProperties.AccessibilityView="Raw"
Content="{Binding Path=(um:ControlExtensions.AlternateContent), RelativeSource={RelativeSource TemplatedParent}}"
Content="{Binding Path=(um:ControlExtensions.AlternateContent), RelativeSource={RelativeSource TemplatedParent}, FallbackValue=' ', TargetNullValue=' '}"
lesterbotello marked this conversation as resolved.
Show resolved Hide resolved
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

<smtx:XamlDisplay UniqueKey="ControlExtensionsSamplePage_ToggleButtonIcon"
Style="{StaticResource XamlDisplayBelowStyle}">
<ToggleButton Style="{StaticResource MaterialToggleButtonIconStyle}">
<ToggleButton Style="{StaticResource MaterialIconToggleButtonStyle}">
<ToggleButton.Content>
<PathIcon Data="{StaticResource Icon_more_horizontal}" />
</ToggleButton.Content>
Expand All @@ -137,6 +137,20 @@
</ToggleButton>
</smtx:XamlDisplay>

<smtx:XamlDisplay UniqueKey="ControlExtensionsSamplePage_ToggleButtonIconWithSymbolIcon_NoAlternateContent"
Style="{StaticResource XamlDisplayBelowStyle}">
<ToggleButton Style="{StaticResource MaterialIconToggleButtonStyle}">
<ToggleButton.Content>
<SymbolIcon Symbol="Accept" />
</ToggleButton.Content>
</ToggleButton>
</smtx:XamlDisplay>

<smtx:XamlDisplay UniqueKey="ControlExtensionsSamplePage_ToggleButtonIconWithPathIconOnly_NoAlternateContent"
Style="{StaticResource XamlDisplayBelowStyle}">
<ToggleButton Style="{StaticResource MaterialIconToggleButtonStyle}"
Content="Hello" />
</smtx:XamlDisplay>
</StackPanel>
</StackPanel>
</ScrollViewer>
Expand Down
Loading