Skip to content

Commit

Permalink
Fix LandmarkType in InfoBar (#6986)
Browse files Browse the repository at this point in the history
* Fix Landmark type

* Move Lnadmark type to border

* Sets landmarktype on infobar itself to not interfere with current uitree
  • Loading branch information
bkudiess authored May 4, 2022
1 parent 7711148 commit ba45dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions dev/InfoBar/InfoBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ void InfoBar::OnApplyTemplate()
winrt::AutomationProperties::SetName(iconTextblock, ResourceAccessor::GetLocalizedStringResource(GetIconSeverityLevelResourceName(Severity())));
}

if (auto&& contentRootGrid = GetTemplateChildT<winrt::Button>(c_contentRootName, controlProtected))
{
winrt::AutomationProperties::SetLocalizedLandmarkType(contentRootGrid, ResourceAccessor::GetLocalizedStringResource(SR_InfoBarCustomLandmarkName));
}
winrt::AutomationProperties::SetLocalizedLandmarkType(*this, ResourceAccessor::GetLocalizedStringResource(SR_InfoBarCustomLandmarkName));

UpdateVisibility(m_notifyOpen, true);
m_notifyOpen = false;
Expand Down
4 changes: 2 additions & 2 deletions dev/InfoBar/InfoBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{ThemeResource InfoBarBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource InfoBarBorderThickness}" />
<Setter Property="AutomationProperties.LandmarkType" Value="Custom" />
<contract7Present:Setter Property="AutomationProperties.IsDialog" Value="True"/>
<contract7Present:Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:InfoBar">
<Border x:Name="ContentRoot"
<Border x:Name="ContentRoot"
VerticalAlignment="Top"
Background="{ThemeResource InfoBarInformationalSeverityBackgroundBrush}"
BorderBrush="{TemplateBinding BorderBrush}"
Expand Down Expand Up @@ -168,7 +169,6 @@
primitives:InfoBarPanel.HorizontalOrientationMargin="{StaticResource InfoBarTitleHorizontalOrientationMargin}"
primitives:InfoBarPanel.VerticalOrientationMargin="{StaticResource InfoBarTitleVerticalOrientationMargin}"
TextWrapping="WrapWholeWords"
AutomationProperties.LandmarkType="Navigation"
FontWeight="{StaticResource InfoBarTitleFontWeight}"
FontSize="{StaticResource InfoBarTitleFontSize}"/>

Expand Down

0 comments on commit ba45dbd

Please sign in to comment.