<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:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
             xmlns:xaml="clr-namespace:PixiEditor.AvaloniaUI.Models.Commands.XAML"
             xmlns:dataHolders="clr-namespace:PixiEditor.AvaloniaUI.Models.UserData"
             xmlns:viewModels="clr-namespace:PixiEditor.AvaloniaUI.ViewModels"
             xmlns:dialogs="clr-namespace:PixiEditor.AvaloniaUI.Views.Dialogs"
             xmlns:input="clr-namespace:PixiEditor.AvaloniaUI.Views.Input;assembly=PixiEditor.UI.Common"
             xmlns:menu="clr-namespace:PixiEditor.AvaloniaUI.ViewModels.Menu"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:DataType="menu:MenuBarViewModel"
             x:Class="PixiEditor.AvaloniaUI.Views.Main.MainTitleBar">
    <Design.DataContext>
        <menu:MenuBarViewModel/>
    </Design.DataContext>
    <Grid>
        <dialogs:DialogTitleBar 
            DockPanel.Dock="Top"/>
        <Svg DockPanel.Dock="Left" Margin="10, 0, 0, 0" HorizontalAlignment="Left" Path="/Images/PixiEditorLogo.svg" Width="20" Height="20"/>
        <xaml:Menu
            Margin="40, 0, 0, 0"
                DockPanel.Dock="Left"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                ItemsSource="{Binding MenuEntries}"
                Background="Transparent"/>
        <Border Width="300" Height="25"
                Background="{DynamicResource ThemeBackgroundBrush}"
                CornerRadius="5" BorderThickness="1"
                Margin="10,0,0,0"
                Cursor="IBeam">
            <Border.Styles>
                <Style Selector="Border">
                    <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
                </Style>
                <Style Selector="Border:pointerover">
                    <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/>
                </Style>
            </Border.Styles>
            <Interaction.Behaviors>
                <EventTriggerBehavior
                    EventName="PointerPressed">
                    <InvokeCommandAction
                        Command="{xaml:Command PixiEditor.Search.Toggle}"/>
                </EventTriggerBehavior>
            </Interaction.Behaviors>
            <Grid Margin="5,0" VerticalAlignment="Center">
                <TextBlock ui:Translator.Key="SEARCH"/>
                <TextBlock Text="{xaml:ShortcutBinding PixiEditor.Search.Toggle}"
                           HorizontalAlignment="Right"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
