Skip to content

Commit

Permalink
fix: Fix AlternateContent for ToogleButton crashing on UWP when not set
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterbotello committed Aug 7, 2023
1 parent 8b41c7d commit 4402407
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
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=' '}"
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

0 comments on commit 4402407

Please sign in to comment.