Files
maui-linux/samples/ShellDemo/Pages/DialogsPage.xaml
Dave Friedel bc80436a34 Add DialogsPage and MoreControlsPage to ShellDemo
DialogsPage demonstrates:
- Alert dialogs (simple, confirmation)
- Action sheets (with destructive option)
- Input prompts (text, numeric)
- File pickers (single, multiple, images)
- Folder picker

MoreControlsPage demonstrates:
- Stepper (basic and custom range)
- RadioButton (vertical and horizontal groups)
- Image placeholders with aspect modes
- Clipboard (copy/paste)
- Share and Launcher services
- BoxView shapes and dividers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:05:50 -05:00

138 lines
6.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShellDemo.Pages.DialogsPage"
Title="Dialogs"
BackgroundColor="{StaticResource PageBackground}">
<Grid RowDefinitions="*,Auto">
<ScrollView Grid.Row="0">
<VerticalStackLayout Padding="20" Spacing="20">
<Label Text="Dialogs &amp; File Pickers" FontSize="24" FontAttributes="Bold" />
<!-- Alert Dialogs -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="12">
<Label Text="Alert Dialogs" FontSize="16" FontAttributes="Bold" />
<Button Text="Simple Alert"
BackgroundColor="{StaticResource PrimaryColor}"
TextColor="White"
Clicked="OnSimpleAlertClicked" />
<Button Text="Confirmation (Yes/No)"
BackgroundColor="{StaticResource WarningColor}"
TextColor="White"
Clicked="OnConfirmationClicked" />
<Label x:Name="AlertResultLabel" Text="Result: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
</VerticalStackLayout>
</Border>
<!-- Action Sheet -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="12">
<Label Text="Action Sheet" FontSize="16" FontAttributes="Bold" />
<Button Text="Show Action Sheet"
BackgroundColor="{StaticResource PurpleColor}"
TextColor="White"
Clicked="OnActionSheetClicked" />
<Button Text="With Destructive Option"
BackgroundColor="{StaticResource DangerColor}"
TextColor="White"
Clicked="OnDestructiveActionSheetClicked" />
<Label x:Name="ActionResultLabel" Text="Selection: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
</VerticalStackLayout>
</Border>
<!-- Prompt Dialog -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="12">
<Label Text="Input Prompts" FontSize="16" FontAttributes="Bold" />
<Button Text="Text Input Prompt"
BackgroundColor="{StaticResource SuccessColor}"
TextColor="White"
Clicked="OnTextPromptClicked" />
<Button Text="Numeric Prompt"
BackgroundColor="{StaticResource SuccessColor}"
TextColor="White"
Clicked="OnNumericPromptClicked" />
<Label x:Name="PromptResultLabel" Text="Input: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" />
</VerticalStackLayout>
</Border>
<!-- File Pickers -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="12">
<Label Text="File Pickers" FontSize="16" FontAttributes="Bold" />
<Button Text="Pick a File"
BackgroundColor="#795548"
TextColor="White"
Clicked="OnPickFileClicked" />
<Button Text="Pick Multiple Files"
BackgroundColor="#795548"
TextColor="White"
Clicked="OnPickMultipleFilesClicked" />
<Button Text="Pick Image"
BackgroundColor="#E91E63"
TextColor="White"
Clicked="OnPickImageClicked" />
<Button Text="Pick Folder"
BackgroundColor="#607D8B"
TextColor="White"
Clicked="OnPickFolderClicked" />
<Label x:Name="FileResultLabel" Text="Selected: (none)" TextColor="{StaticResource TextSecondary}" FontSize="12" LineBreakMode="TailTruncation" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</ScrollView>
<!-- Event Log -->
<Border Grid.Row="1" BackgroundColor="#F5F5F5" Padding="12" StrokeThickness="0">
<VerticalStackLayout>
<Label Text="Event Log:" FontSize="12" FontAttributes="Bold" />
<ScrollView HeightRequest="60">
<Label x:Name="EventLog" Text="Events will appear here..." FontSize="11" TextColor="{StaticResource TextSecondary}" LineBreakMode="WordWrap" />
</ScrollView>
</VerticalStackLayout>
</Border>
</Grid>
</ContentPage>