<Window x:Class="PixiEditor.Views.Dialogs.OptionPopup"
        x:ClassModifier="internal"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
        xmlns:uc="clr-namespace:PixiEditor.Views.UserControls"
        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
        xmlns:views="clr-namespace:PixiEditor.Views"
        xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen"
        SizeToContent="WidthAndHeight"
        x:Name="popup"
        Background="{StaticResource AccentColor}" Foreground="White"
        FlowDirection="{helpers:Localization FlowDirection}"
        ui:Translator.Key="{Binding Title, ElementName=popup}">

    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
                      ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
    </WindowChrome.WindowChrome>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <local:DialogTitleBar TitleKey="{Binding Title, ElementName=popup}" CloseCommand="{Binding CancelCommand, ElementName=popup}"/>

        <ContentPresenter Content="{Binding PopupContent, ElementName=popup}"
                          Grid.Row="1" Margin="15"/>

        <ItemsControl ItemsSource="{Binding Options, ElementName=popup}" Grid.Row="2" Margin="15">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Content="{Binding}" Style="{StaticResource DarkRoundButton}" MinWidth="70" Margin="5,0"
                            Command="{Binding CloseCommand, ElementName=popup}" CommandParameter="{Binding}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <uc:AlignableWrapPanel HorizontalAlignment="Center" HorizontalContentAlignment="Center"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
    </Grid>
</Window>
