<UserControl x:Class="SPCode.UI.Components.EditorElement"
             xmlns:editor="http://icsharpcode.net/sharpdevelop/avalonedit"
             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" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

  <UserControl.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary>
          <Storyboard x:Key="FadeISACIn">
            <DoubleAnimation Duration="00:00:00.1" To="1" Storyboard.TargetName="TooltipGrid" Storyboard.TargetProperty="Opacity" />
          </Storyboard>
          <Storyboard x:Key="FadeISACOut">
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="TooltipGrid" Storyboard.TargetProperty="Opacity" />
          </Storyboard>

          <Storyboard x:Key="FadeACIn">
            <DoubleAnimation Duration="00:00:00.1" To="260" Storyboard.TargetName="AutoCompleteBox" Storyboard.TargetProperty="Width" />
            <DoubleAnimation Duration="00:00:00.1" To="260" Storyboard.TargetName="MethodAutoCompleteBox" Storyboard.TargetProperty="Width" />
            <DoubleAnimation Duration="00:00:00.1" To="260" Storyboard.TargetName="PreProcAutocompleteBox" Storyboard.TargetProperty="Width" />
          </Storyboard>
          <Storyboard x:Key="FadeACOut">
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="AutoCompleteBox" Storyboard.TargetProperty="Width" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="MethodAutoCompleteBox" Storyboard.TargetProperty="Width" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="PreProcAutocompleteBox" Storyboard.TargetProperty="Width" />
          </Storyboard>

          <Storyboard x:Key="FadeAC_FuncC_In">
            <DoubleAnimation Duration="00:00:00.1" To="1" Storyboard.TargetName="AutoCompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="MethodAutoCompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="PreProcAutocompleteBox" Storyboard.TargetProperty="Opacity" />
          </Storyboard>
          <Storyboard x:Key="FadeAC_MethodC_In">
            <DoubleAnimation Duration="00:00:00.1" To="1" Storyboard.TargetName="MethodAutoCompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="AutoCompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="PreProcAutocompleteBox" Storyboard.TargetProperty="Opacity" />
          </Storyboard>
          <Storyboard x:Key="FadeAC_PreProc_In">
            <DoubleAnimation Duration="00:00:00.1" To="1" Storyboard.TargetName="PreProcAutocompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="MethodAutoCompleteBox" Storyboard.TargetProperty="Opacity" />
            <DoubleAnimation Duration="00:00:00.1" To="0" Storyboard.TargetName="AutoCompleteBox" Storyboard.TargetProperty="Opacity" />
          </Storyboard>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </UserControl.Resources>
  <Grid Background="{DynamicResource WhiteColorBrush}">
    <editor:TextEditor x:Name="editor" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,20" ShowLineNumbers="True" FontFamily="Consolas"
                           TextChanged="Editor_TextChanged" Foreground="{DynamicResource BlackColorBrush}" >
      <editor:TextEditor.ContextMenu>
        <ContextMenu Opened="ContextMenu_Opening">
          <MenuItem Name="MenuC_Undo" Header="Undo" Tag="0" Click="HandleContextMenuCommand" />
          <MenuItem Name="MenuC_Redo" Header="Redo" Tag="1" Click="HandleContextMenuCommand" />
          <Separator />
          <MenuItem Name="MenuC_Cut" Header="Cut" Tag="2" Click="HandleContextMenuCommand" />
          <MenuItem Name="MenuC_Copy" Header="Copy" Tag="3" Click="HandleContextMenuCommand" />
          <MenuItem Name="MenuC_Paste" Header="Paste" Tag="4" Click="HandleContextMenuCommand" />
          <Separator />
          <MenuItem Name="MenuC_SelectAll" Header="Select All" Tag="5" Click="HandleContextMenuCommand" />
        </ContextMenu>
      </editor:TextEditor.ContextMenu>
    </editor:TextEditor>
    <CheckBox x:Name="CompileBox" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="2,0,0,0" Content="Compile" Foreground="{DynamicResource BlackColorBrush}" />
    <CheckBox x:Name="DontCreateFileBox" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="92,0,0,0" Foreground="{DynamicResource BlackColorBrush}" />
    <TextBlock Name="StatusLine_FontSize" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="2" Text="14 pt" Foreground="{DynamicResource BlackColorBrush}" IsHitTestVisible="False" />
    <TextBlock Name="StatusLine_Column" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="2,2,100,2" Text="Col 0" Foreground="{DynamicResource BlackColorBrush}" IsHitTestVisible="False" />
    <TextBlock Name="StatusLine_Offset" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,151,2" Foreground="{DynamicResource BlackColorBrush}" IsHitTestVisible="False" />
    <TextBlock Name="StatusLine_Line" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="2,2,200,2" Text="Ln 0" Foreground="{DynamicResource BlackColorBrush}" IsHitTestVisible="False" />
    <TextBlock Name="StatusLine_SelectionLength" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="2,2,300,2" Text="Len 0" Foreground="{DynamicResource BlackColorBrush}" />
    <Grid Name="TooltipGrid" Opacity="0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="Auto" IsHitTestVisible="False">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Name="DocColumn" Width="0" />
      </Grid.ColumnDefinitions>
      <Grid VerticalAlignment="Top" Name="ISenseGrid" Grid.Column="1" Width="Auto" Height="Auto">
        <Border BorderBrush="{DynamicResource AccentColorBrush}" BorderThickness="1" Height="Auto">
          <Grid Height="Auto" Background="{DynamicResource WhiteColorBrush}">
            <TextBlock Name="DocFuncSignature" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="2,0,2,0" Width="Auto" FontSize="15" Foreground="{DynamicResource AccentColorBrush}" />
            <TextBlock Name="DocFuncDescription" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" Margin="5,20,2,2" FontFamily="Consolas" FontSize="13" Foreground="{DynamicResource BlackColorBrush}" />
          </Grid>
        </Border>
      </Grid>
      <Border Name="ACBorder" Grid.Column="0" Background="{DynamicResource WhiteColorBrush}" VerticalAlignment="Top" BorderBrush="{DynamicResource AccentColorBrush}" BorderThickness="1" Height="0">
        <Grid>

          <ListBox Name="AutoCompleteBox" 
                   HorizontalAlignment="Stretch" 
                   VerticalAlignment="Top" 
                   Grid.Column="0" 
                   Width="0"
                   Height="175" 
                   Background="Transparent" 
                   Opacity="1" 
                   Foreground="{DynamicResource BlackColorBrush}"
                   ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                   ScrollViewer.VerticalScrollBarVisibility="Hidden" />

          <ListBox Name="MethodAutoCompleteBox" 
                   HorizontalAlignment="Stretch" 
                   VerticalAlignment="Top" 
                   Grid.Column="0" 
                   Width="0"
                   Height="175" 
                   Background="Transparent" 
                   Opacity="0" 
                   Foreground="{DynamicResource BlackColorBrush}"
                   ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                   ScrollViewer.VerticalScrollBarVisibility="Hidden" />
          
          <ListBox Name="PreProcAutocompleteBox" 
                   HorizontalAlignment="Stretch" 
                   VerticalAlignment="Top" 
                   Grid.Column="0" 
                   Width="0"
                   Height="175" 
                   Background="Transparent" 
                   Opacity="0" 
                   Foreground="{DynamicResource BlackColorBrush}"
                   ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                   ScrollViewer.VerticalScrollBarVisibility="Hidden" />

        </Grid>
      </Border>
    </Grid>
  </Grid>
</UserControl>
