Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
58 changes: 29 additions & 29 deletions samples/CommunityToolkit.Maui.Sample/Views/Popups/ButtonPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
BackgroundColor="LightCoral">

<VerticalStackLayout Spacing="6">
<VerticalStackLayout.Resources>
<ResourceDictionary>
<Style x:Key="Title" TargetType="Label">
<Setter Property="FontSize" Value="26" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="#000" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
<Style x:Key="Divider" TargetType="BoxView">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="Margin" Value="50, 12" />
<Setter Property="Color" Value="#c3c3c3" />
</Style>
<Style x:Key="Content" TargetType="Label">
<Setter Property="HorizontalTextAlignment" Value="Start" />
<Setter Property="VerticalTextAlignment" Value="Center" />
</Style>
<Style x:Key="ConfirmButton" TargetType="Button">
<Setter Property="VerticalOptions" Value="End" />
</Style>
</ResourceDictionary>
</VerticalStackLayout.Resources>
<VerticalStackLayout Spacing="6">
<VerticalStackLayout.Resources>
<ResourceDictionary>
<Style x:Key="Title" TargetType="Label">
<Setter Property="FontSize" Value="26" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="#000" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
<Style x:Key="Divider" TargetType="BoxView">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="Margin" Value="50, 12" />
<Setter Property="Color" Value="#c3c3c3" />
</Style>
<Style x:Key="Content" TargetType="Label">
<Setter Property="HorizontalTextAlignment" Value="Start" />
<Setter Property="VerticalTextAlignment" Value="Center" />
</Style>
<Style x:Key="ConfirmButton" TargetType="Button">
<Setter Property="VerticalOptions" Value="End" />
</Style>
</ResourceDictionary>
</VerticalStackLayout.Resources>

<Label Style="{StaticResource Title}" Text="Button Popup" />
<BoxView Style="{StaticResource Divider}" />
<Label Style="{StaticResource Content}" Text="This is a platform specific popup with a .NET MAUI View being rendered. The behaviors of the popup will confirm to 100% this platform look and feel, but still allows you to use your .NET MAUI controls." />
<Button
<Label Style="{StaticResource Title}" Text="Button Popup" Loaded="Label_Loaded" />
<BoxView Style="{StaticResource Divider}" />
<Label Style="{StaticResource Content}" Text="This is a platform specific popup with a .NET MAUI View being rendered. The behaviors of the popup will confirm to 100% this platform look and feel, but still allows you to use your .NET MAUI controls." />
<Button
Clicked="Button_Clicked"
Style="{StaticResource ConfirmButton}"
Text="OKAY" />
</VerticalStackLayout>
</VerticalStackLayout>
</mct:Popup>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ void Button_Clicked(object? sender, EventArgs e)
{
CloseAsync();
}

void Label_Loaded(object? sender, EventArgs e)
{
if (sender is Label label)
{
label.SetSemanticFocus();
}
}
}
3 changes: 3 additions & 0 deletions src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ public PopupPageLayout(in Popup popupContent, in IPopupOptions options, in Actio

Children.Add(TapGestureGestureOverlay);
Children.Add(PopupBorder);

AutomationProperties.SetIsInAccessibleTree(this, false);
AutomationProperties.SetIsInAccessibleTree(PopupBorder, false);
Comment on lines +255 to +256
}

void HandleOverlayTapped(object? sender, TappedEventArgs e)
Expand Down
Loading