<ui:ContentDialog
    x:Class="ModernWpf.SampleApp.ControlPages.TestContentDialog"
    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"
    d:DesignHeight="756"
    d:DesignWidth="548"
    x:Name="dialog"
    Title="Title"
    PrimaryButtonText="Yes"
    SecondaryButtonText="No"
    CloseButtonText="Cancel"
    DefaultButton="Primary"
    PrimaryButtonClick="OnPrimaryButtonClick"
    SecondaryButtonClick="OnSecondaryButtonClick"
    CloseButtonClick="OnCloseButtonClick"
    Closed="OnClosed">
    <ui:SimpleStackPanel Spacing="12">
        <TextBox
            ui:ControlHelper.Header="Title"
            Text="{Binding ElementName=dialog, Path=Title, UpdateSourceTrigger=PropertyChanged}"
            AcceptsReturn="True" />
        <TextBox
            ui:ControlHelper.Header="PrimaryButtonText"
            Text="{Binding ElementName=dialog, Path=PrimaryButtonText, UpdateSourceTrigger=PropertyChanged}" />
        <TextBox
            ui:ControlHelper.Header="SecondaryButtonText"
            Text="{Binding ElementName=dialog, Path=SecondaryButtonText, UpdateSourceTrigger=PropertyChanged}" />
        <TextBox
            ui:ControlHelper.Header="CloseButtonText"
            Text="{Binding ElementName=dialog, Path=CloseButtonText, UpdateSourceTrigger=PropertyChanged}" />
        <ComboBox
            ui:ControlHelper.Header="DefaultButton"
            ItemsSource="{Binding Source={x:Type ui:ContentDialogButton}, Converter={StaticResource EnumValuesConverter}}"
            SelectedItem="{Binding ElementName=dialog, Path=DefaultButton}" />
        <CheckBox
            Content="FullSizeDesired"
            IsChecked="{Binding ElementName=dialog, Path=FullSizeDesired}" />
        <CheckBox
            Content="IsShadowEnabled"
            IsChecked="{Binding ElementName=dialog, Path=IsShadowEnabled}" />
        <StackPanel>
            <Button
                Content="Try to open another ContentDialog"
                Click="TryOpenAnother" />
            <TextBlock
                x:Name="ErrorText"
                Style="{StaticResource BodyTextBlockStyle}"
                Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"
                Margin="0,8,0,0"
                Visibility="Collapsed" />
        </StackPanel>
    </ui:SimpleStackPanel>
</ui:ContentDialog>
