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

    <ScrollViewer>
        <ui:SimpleStackPanel Style="{StaticResource ControlPageContentPanelStyle}">
            <sc:ControlExample
                x:Name="Example1"
                HeaderText="Select different looks for the person picture.">

                <sc:ControlExample.Example>
                    <ui:PersonPicture
                        x:Name="personPicture"
                        Height="300"
                        VerticalAlignment="Top"
                        ProfilePicture="{Binding IsChecked, ElementName=ProfileImageRadio, Converter={StaticResource booleanToValueConverter}, ConverterParameter='https://docs.microsoft.com/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png'}"
                        DisplayName="{Binding IsChecked, ElementName=DisplayNameRadio, Converter={StaticResource booleanToValueConverter}, ConverterParameter='Jane Doe'}"
                        Initials="{Binding IsChecked, ElementName=InitialsRadio, Converter={StaticResource booleanToValueConverter}, ConverterParameter='SB'}" />
                </sc:ControlExample.Example>

                <sc:ControlExample.Options>
                    <StackPanel>
                        <RadioButton
                            x:Name="ProfileImageRadio"
                            GroupName="Profile"
                            Content="Profile Image"
                            IsChecked="True" />
                        <RadioButton
                            x:Name="DisplayNameRadio"
                            GroupName="Profile"
                            Content="Display Name" />
                        <RadioButton
                            x:Name="InitialsRadio"
                            GroupName="Profile"
                            Content="Initials" />
                    </StackPanel>
                </sc:ControlExample.Options>
            </sc:ControlExample>

            <sc:ControlExample
                x:Name="Example2"
                HeaderText="API in action.">

                <sc:ControlExample.Example>
                    <ui:PersonPicture
                        x:Name="personPicture2"
                        Height="300"
                        VerticalAlignment="Top"
                        ProfilePicture="{Binding IsChecked, ElementName=ProfileImageCheck, Converter={StaticResource booleanToValueConverter}, ConverterParameter='https://docs.microsoft.com/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png'}"
                        DisplayName="Jane Doe"
                        Initials="SB" />
                </sc:ControlExample.Example>

                <sc:ControlExample.Options>
                    <ui:SimpleStackPanel Style="{StaticResource OptionsPanelStyle}">
                        <TextBox
                            ui:ControlHelper.Header="BadgeGlyph"
                            Text="{Binding ElementName=personPicture2, Path=BadgeGlyph, UpdateSourceTrigger=PropertyChanged}" />
                        <ui:NumberBox
                            Header="BadgeNumber"
                            Minimum="0"
                            Value="{Binding ElementName=personPicture2, Path=BadgeNumber}"
                            SpinButtonPlacementMode="Inline" />
                        <TextBox
                            ui:ControlHelper.Header="DisplayName"
                            Text="{Binding ElementName=personPicture2, Path=DisplayName, UpdateSourceTrigger=PropertyChanged}" />
                        <TextBox
                            ui:ControlHelper.Header="Initials"
                            Text="{Binding ElementName=personPicture2, Path=Initials, UpdateSourceTrigger=PropertyChanged}" />
                        <CheckBox
                            Content="IsGroup"
                            IsChecked="{Binding ElementName=personPicture2, Path=IsGroup}" />
                        <CheckBox
                            x:Name="ProfileImageCheck"
                            Content="Profile Image"
                            IsChecked="True" />
                    </ui:SimpleStackPanel>
                </sc:ControlExample.Options>
            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
