<UserControl x:Class="XamlEditor.Views.EditorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:themes="clr-namespace:XamlTheme;assembly=XamlTheme"
             xmlns:controls="clr-namespace:XamlTheme.Controls;assembly=XamlTheme"
             prism:ViewModelLocator.AutoWireViewModel="True">
    <behaviors:Interaction.Triggers>
        <behaviors:EventTrigger EventName="Loaded">
            <behaviors:InvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="true"/>
        </behaviors:EventTrigger> 
    </behaviors:Interaction.Triggers>
    <Grid Background="White">
        <controls:TextEditorEx x:Name="XamlTextEditorEx"
                               Margin="6,0,0,0"
                               AllowSearch="true"
                               SyntaxHighlighting="XML"
                               IsCodeCompletion="{Binding CodeCompletion}"
                               IsReadOnly="{Binding IsReadOnly}"
                               LineNumber="{Binding CaretLine, Mode=TwoWay}"
                               LinePosition="{Binding CaretColumn, Mode=TwoWay}"
                               IsModified="{Binding IsModified, Mode=TwoWay}"
                               WordWrap="{Binding WordWrap}"
                               ShowLineNumbers="{Binding ShowLineNumber}"
                               FontFamily="{Binding FontFamily}"
                               FontSize="{Binding FontSize}"
                               Delay="{Binding AutoCompileDelay}"
                               GenerateCompletionData="{Binding GenerateCompletionDataFunc}">
            <controls:TextEditorEx.Resources>
                <Style TargetType="ScrollViewer"
                       BasedOn="{StaticResource {x:Static themes:ResourceKeys.NormalScrollViewerStyleKey}}"/> 
            </controls:TextEditorEx.Resources>
            <behaviors:Interaction.Triggers>
                <behaviors:EventTrigger EventName="DelayArrived">
                    <behaviors:InvokeCommandAction Command="{Binding DelayArrivedCommand}"/>
                </behaviors:EventTrigger>
                <behaviors:EventTrigger EventName="TextChanged">
                    <behaviors:InvokeCommandAction Command="{Binding TextChangedCommand}"/>
                </behaviors:EventTrigger>
            </behaviors:Interaction.Triggers>
        </controls:TextEditorEx>
    </Grid>
</UserControl>
