<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.ProgressPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon"
    mc:Ignorable="d">

    <ScrollViewer>
        <ui:SimpleStackPanel Style="{StaticResource ControlPageContentPanelStyle}">
            <sc:ControlExample HeaderText="An indeterminate progress bar.">
                <ui:ProgressBar
                    Width="130"
                    IsIndeterminate="True"
                    VerticalAlignment="Top"
                    Margin="10,10,0,0"
                    ShowPaused="{Binding IsChecked, ElementName=PausedRB}"
                    ShowError="{Binding IsChecked, ElementName=ErrorRB}" />

                <sc:ControlExample.Options>
                    <StackPanel>
                        <RadioButton
                            x:Name="RunningRB"
                            GroupName="ProgressState"
                            Content="Running"
                            IsChecked="True" />
                        <RadioButton
                            x:Name="PausedRB"
                            GroupName="ProgressState"
                            Content="Paused" />
                        <RadioButton
                            x:Name="ErrorRB"
                            GroupName="ProgressState"
                            Content="Error" />
                    </StackPanel>
                </sc:ControlExample.Options>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="A determinate progress bar.">
                <StackPanel Orientation="Horizontal">
                    <ProgressBar
                        x:Name="ProgressBar2"
                        Width="130"
                        Value="{Binding ElementName=ProgressValue, Path=Value, Mode=OneWay}" />
                    <TextBlock
                        x:Name="Control2Output"
                        Style="{StaticResource OutputTextBlockStyle}"
                        Width="60"
                        TextAlignment="Center" />
                    <TextBlock
                        x:Name="ProgresLabel"
                        Text="Progress"
                        VerticalAlignment="Center"
                        Margin="0,0,10,0" />
                    <ui:NumberBox
                        x:Name="ProgressValue"
                        AutomationProperties.LabeledBy="{Binding ElementName=ProgresLabel}"
                        Minimum="0"
                        Maximum="100"
                        Value="0"
                        SpinButtonPlacementMode="Inline" />
                </StackPanel>
            </sc:ControlExample>

            <sc:ControlExample
                HeaderText="An indeterminate progress ring."
                VerticalContentAlignment="Center">
                <ui:ProgressRing
                    IsActive="{Binding IsOn, ElementName=ProgressToggle}"
                    Height="60"
                    Width="60" />

                <sc:ControlExample.Options>
                    <ui:ToggleSwitch
                        x:Name="ProgressToggle"
                        Header="Toggle work"
                        OffContent="Do work"
                        OnContent="Working"
                        IsOn="True" />
                </sc:ControlExample.Options>
            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
