<UserControl xmlns="https://github.com/avaloniaui"
             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:viewModels="clr-namespace:PixiEditor.AvaloniaUI.ViewModels"
             xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
             xmlns:xaml="clr-namespace:PixiEditor.AvaloniaUI.Models.Commands.XAML"
             xmlns:colorPicker="clr-namespace:ColorPicker;assembly=ColorPicker.AvaloniaUI"
             xmlns:visuals="clr-namespace:PixiEditor.AvaloniaUI.Views.Visuals"
             xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:DataType="viewModels:ViewModelMain"
             x:Class="PixiEditor.AvaloniaUI.Views.Main.ActionDisplayBar">
    <Design.DataContext>
        <viewModels:ViewModelMain />
    </Design.DataContext>

    <Grid Background="{DynamicResource ThemeBackgroundBrush1}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="40" />
            <ColumnDefinition
                Width="*" />
            <ColumnDefinition
                Width="290" />
        </Grid.ColumnDefinitions>
        <!--<visuals:ColorsPreviewer/>-->
        <colorPicker:ColorDisplay SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Converter={converters:GenericColorToMediaColorConverter}}"
                                  SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Converter={converters:GenericColorToMediaColorConverter}}">
            <colorPicker:ColorDisplay.Styles>
                <Style Selector="Button">
                    <Setter Property="IsVisible" Value="False"/>
                </Style>
            </colorPicker:ColorDisplay.Styles>
        </colorPicker:ColorDisplay>
        <DockPanel Grid.Column="1">
            <TextBlock
                ui:Translator.LocalizedString="{Binding ActiveActionDisplay}"
                Foreground="White"
                FontSize="15"
                Margin="10,0,0,0"
                VerticalAlignment="Center" />
            <StackPanel
                DockPanel.Dock="Right"
                Orientation="Horizontal"
                HorizontalAlignment="Right"
                VerticalAlignment="Center">
                <TextBlock
                    Text="{Binding ElementName=mainWindow, Path=DataContext.DocumentManagerSubViewModel.ActiveDocument.CoordinatesString}"
                    Foreground="White"
                    FontSize="16" />
            </StackPanel>
        </DockPanel>
        <StackPanel
            Margin="10,0,0,0"
            VerticalAlignment="Center"
            Grid.Column="2"
            Orientation="Horizontal">
            <Button
                IsVisible="{Binding UpdateSubViewModel.UpdateReadyToInstall, FallbackValue=Hidden}"
                FontSize="14"
                Height="20"
                Command="{xaml:Command PixiEditor.Restart}" ui:Translator.Key="RESTART" />
            <TextBlock
                VerticalAlignment="Center"
                Padding="10"
                HorizontalAlignment="Right"
                Foreground="White"
                FontSize="14"
                Text="{Binding UpdateSubViewModel.VersionText}" />
        </StackPanel>
    </Grid>
</UserControl>