<UserControl x:Class="FasdDesktopUi.Basics.UserControls.CustomDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"             
             xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800"
             x:Name="YesNoControl">

    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
        <vc:BoolOrToVisibilityConverter x:Key="BoolOrToVisibilityConverter" />
    </UserControl.Resources>
    
    <Border Padding="10"
            CornerRadius="10"
            Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Value}">

        <DockPanel>

            <ico:AdaptableIcon SelectedInternIcon="window_close"
                               DockPanel.Dock="Top"
                               HorizontalAlignment="Right"
                               Style="{DynamicResource SettingsPage.Close.Icon}" />

            <local:YesNoButton HasYesNoButtons="{Binding ElementName=YesNoControl, Path=HasYesNoButtons}"
                               HasYesNoText="{Binding ElementName=YesNoControl, Path=HasYesNoText}"
                               DockPanel.Dock="Bottom"
                               HorizontalAlignment="Center"
                               ButtonHasBeenClicked="YesNoButton_ButtonHasBeenClicked">
                <local:YesNoButton.Visibility>
                    <MultiBinding Converter="{StaticResource BoolOrToVisibilityConverter}">
                        <Binding Path="HasYesNoButtons" ElementName="YesNoControl"/>
                        <Binding Path="HasYesNoText" ElementName="YesNoControl"/>
                    </MultiBinding>
                </local:YesNoButton.Visibility>
            </local:YesNoButton>

            <StackPanel x:Name="MainStack" />            
            
        </DockPanel>

    </Border>

</UserControl>
