<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.RatingControlPage"
    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
                x:Name="Example1"
                HeaderText="A simple RatingControl">

                <StackPanel VerticalAlignment="Top">
                    <ui:RatingControl
                        x:Name="RatingControl1"
                        AutomationProperties.Name="Simple RatingControl"
                        IsClearEnabled="{Binding IsChecked, ElementName=clearEnabledCheck}"
                        IsReadOnly="{Binding IsChecked, ElementName=readOnlyCheck}"
                        HorizontalAlignment="Left" />

                    <StackPanel
                        Orientation="Horizontal"
                        Margin="0,12,0,0">
                        <TextBlock Text="Your Rating:" />
                        <TextBlock
                            Margin="5,0,0,0"
                            FontWeight="Bold"
                            Text="{Binding Value, ElementName=RatingControl1}" />
                    </StackPanel>
                </StackPanel>

                <sc:ControlExample.Options>
                    <StackPanel Width="220">
                        <CheckBox
                            x:Name="clearEnabledCheck"
                            Content="IsClearEnabled" />
                        <!--<TextBlock Text="Swipe left to clear your rating." TextWrapping="Wrap"/>-->
                        <CheckBox
                            x:Name="readOnlyCheck"
                            Content="Is Read Only"
                            Margin="0,12,0,0" />
                    </StackPanel>
                </sc:ControlExample.Options>

            </sc:ControlExample>

            <sc:ControlExample
                x:Name="Example2"
                HeaderText="PlaceholderValue of RatingControl">

                <ui:RatingControl
                    x:Name="RatingControl2"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top"
                    PlaceholderValue="{Binding Value, ElementName=slider, Mode=TwoWay}"
                    AutomationProperties.Name="RatingControl with placeholder" />

                <sc:ControlExample.Options>
                    <StackPanel Width="220">
                        <Slider
                            x:Name="slider"
                            ui:ControlHelper.Header="PlaceholderValue"
                            Minimum="0"
                            Maximum="5"
                            TickFrequency="0.5"
                            SmallChange="0.5"
                            IsSnapToTickEnabled="True"
                            AutoToolTipPlacement="TopLeft"
                            AutoToolTipPrecision="1" />
                    </StackPanel>
                </sc:ControlExample.Options>

            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
