Files
maui-linux/samples/ShellDemo/Pages/ProgressPage.xaml

137 lines
7.1 KiB
Plaintext
Raw Normal View History

<?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.ProgressPage"
Title="Progress"
BackgroundColor="{StaticResource PageBackground}">
<Grid RowDefinitions="*,Auto">
<ScrollView Grid.Row="0">
<VerticalStackLayout Padding="20" Spacing="20">
<Label Text="Progress Indicators" FontSize="24" FontAttributes="Bold" />
<!-- ProgressBar Section -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="15">
<Label Text="ProgressBar" FontSize="16" FontAttributes="Bold" />
<!-- Various progress values -->
<HorizontalStackLayout Spacing="10">
<ProgressBar Progress="0" WidthRequest="200" />
<Label Text="0%" VerticalOptions="Center" WidthRequest="50" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<ProgressBar Progress="0.25" WidthRequest="200" />
<Label Text="25%" VerticalOptions="Center" WidthRequest="50" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<ProgressBar Progress="0.5" WidthRequest="200" />
<Label Text="50%" VerticalOptions="Center" WidthRequest="50" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<ProgressBar Progress="0.75" WidthRequest="200" />
<Label Text="75%" VerticalOptions="Center" WidthRequest="50" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<ProgressBar Progress="1" WidthRequest="200" />
<Label Text="100%" VerticalOptions="Center" WidthRequest="50" />
</HorizontalStackLayout>
<Label Text="Colored Progress Bars:" FontSize="12" Margin="0,10,0,0" />
<ProgressBar Progress="0.7" ProgressColor="Red" />
<ProgressBar Progress="0.7" ProgressColor="Green" />
<ProgressBar Progress="0.7" ProgressColor="Blue" />
<ProgressBar Progress="0.7" ProgressColor="Orange" />
<ProgressBar Progress="0.7" ProgressColor="Purple" />
</VerticalStackLayout>
</Border>
<!-- ActivityIndicator Section -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="15">
<Label Text="ActivityIndicator" FontSize="16" FontAttributes="Bold" />
<HorizontalStackLayout Spacing="15">
<ActivityIndicator IsRunning="True" />
<Label Text="Loading..." VerticalOptions="Center" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="15">
<ActivityIndicator x:Name="ToggleIndicator" IsRunning="False" />
<Button Text="Start/Stop" Clicked="OnToggleIndicatorClicked" />
</HorizontalStackLayout>
<Label Text="Colored Indicators:" FontSize="12" Margin="0,10,0,0" />
<HorizontalStackLayout Spacing="20">
<ActivityIndicator IsRunning="True" Color="Red" />
<ActivityIndicator IsRunning="True" Color="Green" />
<ActivityIndicator IsRunning="True" Color="Blue" />
<ActivityIndicator IsRunning="True" Color="Orange" />
</HorizontalStackLayout>
</VerticalStackLayout>
</Border>
<!-- Interactive Demo Section -->
<Border BackgroundColor="{StaticResource CardBackground}"
Stroke="{StaticResource BorderColor}"
StrokeThickness="1"
Padding="16">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="15">
<Label Text="Interactive Demo" FontSize="16" FontAttributes="Bold" />
<ProgressBar x:Name="AnimatedProgress" Progress="0.5" />
<Slider x:Name="ProgressSlider" Minimum="0" Maximum="100" Value="50" ValueChanged="OnProgressSliderChanged" />
<Label x:Name="ProgressLabel" Text="Progress: 50%" />
<HorizontalStackLayout Spacing="10" Margin="0,10,0,0">
<Button Text="Reset"
BackgroundColor="Gray"
TextColor="White"
Clicked="OnResetClicked" />
<Button Text="Animate to 100%"
BackgroundColor="Blue"
TextColor="White"
Clicked="OnAnimateClicked" />
<Button Text="Simulate Download"
BackgroundColor="Green"
TextColor="White"
Clicked="OnSimulateClicked" />
</HorizontalStackLayout>
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</ScrollView>
<!-- Event Log Panel -->
<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>