<UserControl x:Class="FasdDesktopUi.Basics.UserControls.YesNoButton"
       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:uc="clr-namespace:FasdDesktopUi.Basics.UserControls"
       xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
       xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
       x:Name="YesNoButtons"
       mc:Ignorable="d"
       d:DesignHeight="450"
       d:DesignWidth="800">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
    </UserControl.Resources>
    <Grid>
        <Grid.Resources>
            <vc:LanguageDefinitionsConverter x:Key="LanguageConverter"/>
            <Style TargetType="ico:AdaptableIcon">
                <Setter Property="IconWidth"
				    Value="125"/>
                <Setter Property="PrimaryIconColor"
				    Value="{DynamicResource Color.Menu.Icon}"/>
                <Setter Property="HorizontalAlignment"
				    Value="Center"/>
            </Style>
            <Style TargetType="TextBlock">
                <Setter Property="HorizontalAlignment"
				    Value="Left"/>
                <Setter Property="VerticalAlignment"
				    Value="Center"/>
            </Style>
            <Style TargetType="StackPanel">
                <Setter Property="Cursor"
				    Value="Hand"/>
                <EventSetter Event="MouseLeftButtonUp"
				       Handler="DialogButton_MouseLeftButtonUp"/>
                <EventSetter Event="TouchDown"
				       Handler="DialogButton_TouchDown"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Border>
            <StackPanel x:Name="StackPanelConfirm"
            Grid.Column="0"
		      Orientation="Horizontal"
		      Margin="0 10 0 0"
		      HorizontalAlignment="Center">
                <StackPanel.Tag>
                    <sys:Boolean>True</sys:Boolean>
                </StackPanel.Tag>
                <StackPanel.Style>
                    <Style TargetType="StackPanel"
				    BasedOn="{StaticResource {x:Type StackPanel}}"/>
                </StackPanel.Style>
                <ico:AdaptableIcon x:Name="ConfirmButton"
			          SelectedMaterialIcon="ic_check"
			          Visibility="{Binding ElementName=YesNoButtons, Path=YesNoButtonsVisible, Converter={StaticResource BoolToVisibility}}">
                    <ico:AdaptableIcon.Resources>
                        <Style TargetType="ico:AdaptableIcon"
					    BasedOn="{StaticResource {x:Type ico:AdaptableIcon}}">
                            <Setter Property="PrimaryIconColor"
						    Value="{DynamicResource Color.Menu.Icon}"/>
                            <Setter Property="BorderPadding"
						    Value="2.5"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver"
							     Value="True">
                                    <Setter Property="PrimaryIconColor"
								    Value="{DynamicResource Color.Green}"/>
                                    <Setter Property="IconBackgroundColor"
								    Value="{DynamicResource BackgroundColor.Menu.MainCategory}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ico:AdaptableIcon.Resources>
                </ico:AdaptableIcon>
                <TextBlock x:Name="ConfirmText"
                  Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.Yes}"
			      Margin="5 0 0 0"
			      Padding="30 10 30 10"
			      FontWeight="Bold"
			      VerticalAlignment="Center"
			      Visibility="{Binding ElementName=YesNoButtons, Path=YesNoTextVisible, Converter={StaticResource BoolToVisibility}}">
                    <TextBlock.Style>
                        <Style TargetType="TextBlock"
					    BasedOn="{StaticResource {x:Type TextBlock}}">
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver"
							     Value="True">
                                    <Setter Property="Foreground"
								    Value="{DynamicResource Color.Green}"/>
                                    <Setter Property="Background"
								    Value="{DynamicResource BackgroundColor.Menu.MainCategory}"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver"
							    Value="False">
                                    <Setter Property="Foreground"
								Value="{DynamicResource FontColor.Menu.Categories}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </TextBlock.Style>
                </TextBlock>
            </StackPanel>
        </Border>
        <StackPanel x:Name="StackPanelCancel"
            Grid.Column="1"
		      Margin="0 10 0 0"
		      Orientation="Horizontal"
		      HorizontalAlignment="Center">
            <StackPanel.Tag>
                <sys:Boolean>False</sys:Boolean>
            </StackPanel.Tag>
            <StackPanel.Style>
                <Style TargetType="StackPanel"
				    BasedOn="{StaticResource {x:Type StackPanel}}"/>
            </StackPanel.Style>
            <ico:AdaptableIcon x:Name="CancelButton"
			          SelectedMaterialIcon="ic_close"
			          Visibility="{Binding ElementName=YesNoButtons, Path=YesNoButtonsVisible, Converter={StaticResource BoolToVisibility}}">
                <ico:AdaptableIcon.Resources>
                    <Style TargetType="ico:AdaptableIcon"
					    BasedOn="{StaticResource {x:Type ico:AdaptableIcon}}">
                        <Setter Property="PrimaryIconColor"
						    Value="{DynamicResource Color.Menu.Icon}"/>
                        <Setter Property="BorderPadding"
						    Value="2.5"/>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver"
							     Value="True">
                                <Setter Property="PrimaryIconColor"
								    Value="{DynamicResource Color.Red}"/>
                                <Setter Property="IconBackgroundColor"
								    Value="{DynamicResource BackgroundColor.Menu.MainCategory}"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </ico:AdaptableIcon.Resources>
            </ico:AdaptableIcon>
            <TextBlock x:Name="CancelText"
                  Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Global.No}"
			      Margin="5 0 0 0"
			      Padding="30 10 30 10"
			      FontWeight="Bold"
			      VerticalAlignment="Center"
			      Visibility="{Binding ElementName=YesNoButtons, Path=YesNoTextVisible, Converter={StaticResource BoolToVisibility}}">
                <TextBlock.Style>
                    <Style TargetType="TextBlock"
					    BasedOn="{StaticResource {x:Type TextBlock}}">
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver"
							     Value="True">
                                <Setter Property="Foreground"
								    Value="{DynamicResource Color.Red}"/>
                                <Setter Property="Background"
								    Value="{DynamicResource BackgroundColor.Menu.MainCategory}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver"
							     Value="False">
                                <Setter Property="Foreground"
								    Value="{DynamicResource FontColor.Menu.Categories}"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
        </StackPanel>
        <ico:AdaptableIcon 
            Grid.ColumnSpan="999"
            BorderPadding="0"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            IconHeight="20"
            IconWidth="20"
            SelectedInternGif="loadingSpinner"
            Margin="0,10,0,0"
            Visibility="{Binding ElementName=YesNoButtons, Path=IsClosingBusy, Converter={StaticResource BoolToVisibility}}"
            />
    </Grid>
</UserControl>