<UserControl x:Class="HaRepacker.GUI.Panels.SubPanels.AvalonTextEditor"
             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:HaRepacker.GUI.Panels.SubPanels"
             xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"

             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="26px"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Background="Gray">
            
            <StackPanel Orientation="Horizontal" Margin="5,0,0,0">
                <TextBlock Text="Syntax highlighting: " Foreground="White" VerticalAlignment="Center"/>
                <ComboBox x:Name="comboBox_SyntaxHighlightingType" 
							Grid.Column="1"
							MinWidth="50" Width="150"
							VerticalAlignment="Center" HorizontalAlignment="Left"
							DisplayMemberPath="Name"
							ItemsSource="{Binding HighlightingDefinitions, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
							SelectedItem="{Binding HighlightingDefinition, UpdateSourceTrigger=PropertyChanged}" 
                      SelectionChanged="comboBox_SyntaxHighlightingType_SelectionChanged_1"
                      />
            </StackPanel>

            <Button x:Name="button_saveApply"  
                    Background="#FFD1D1D1" Foreground="Black" Margin="0,0,5,0"
                    Content="Save" Width="150" 
                    HorizontalAlignment="Right" VerticalAlignment="Center" 
                    
                    IsEnabled="False"
                    Click="button_saveApply_Click"/>
        </Grid>
        
        <avalonEdit:TextEditor x:Name="textEditor"
                               Grid.Row="1"
                               SyntaxHighlighting="{Binding HighlightingDefinition}"
                               FontFamily="Consolas" FontSize="12pt" 
            WordWrap="True" ShowLineNumbers="True" 
                               TextChanged="textEditor_TextChanged"
            />
    </Grid>
</UserControl>
