Skip to content
Open
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();
}
}
}
4 changes: 3 additions & 1 deletion src/CommunityToolkit.Maui/Views/Popup/PopupPage.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public PopupPage(Popup popup, IPopupOptions? popupOptions)
await CloseAsync(new PopupResult(true));
}, () => GetCanBeDismissedByTappingOutsideOfPopup(popup, popupOptions));


var pageTapGestureRecognizer = new TapGestureRecognizer();
pageTapGestureRecognizer.Tapped += HandleTapGestureRecognizerTapped;

Expand Down Expand Up @@ -251,6 +250,9 @@ public PopupPageLayout(in Popup popupContent, in IPopupOptions options)
PopupBorder.SetBinding(Border.StrokeThicknessProperty, static (IPopupOptions options) => options.Shape, source: options, mode: BindingMode.OneWay, converter: new BorderStrokeThicknessConverter());

Children.Add(PopupBorder);

AutomationProperties.SetIsInAccessibleTree(this, false);
AutomationProperties.SetIsInAccessibleTree(PopupBorder, false);
}

public Border PopupBorder { get; }
Expand Down
Loading