<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="Avalonia.Diagnostics.Views.ConsoleView">
  <UserControl.Styles>
    <Style Selector="TextBox.console">
      <Setter Property="FontFamily" Value="/Assets/Fonts/SourceSansPro-Regular.ttf"/>
      <Setter Property="Template">
        <ControlTemplate>
          <Border Name="border"
                  Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}">
            <DockPanel Margin="{TemplateBinding Padding}">
              <TextBlock DockPanel.Dock="Left" Margin="0,0,4,0"></TextBlock>
              <TextPresenter Name="PART_TextPresenter"
                             Text="{TemplateBinding Text, Mode=TwoWay}"
                             CaretIndex="{TemplateBinding CaretIndex}"
                             SelectionStart="{TemplateBinding SelectionStart}"
                             SelectionEnd="{TemplateBinding SelectionEnd}"
                             TextAlignment="{TemplateBinding TextAlignment}"
                             TextWrapping="{TemplateBinding TextWrapping}"
                             PasswordChar="{TemplateBinding PasswordChar}"/>
            </DockPanel>
          </Border>
        </ControlTemplate>
      </Setter>
    </Style>
  </UserControl.Styles>
  
  <DockPanel>
    <TextBox Name="input"
             Classes="console"
             DockPanel.Dock="Bottom"
             BorderThickness="0"
             Text="{Binding Input}"/>
    
    <ListBox Name="historyList"
             BorderBrush="{DynamicResource ThemeControlMidBrush}"
             BorderThickness="0,0,0,1"
             FontFamily="/Assets/Fonts/SourceSansPro-Regular.ttf"
             Items="{Binding History}"
             VirtualizationMode="None">
      <ListBox.ItemTemplate>
        <DataTemplate>
          <StackPanel Orientation="Vertical">
            <DockPanel>
              <TextBlock DockPanel.Dock="Left" Margin="0,0,4,0"></TextBlock>
              <TextBlock Text="{Binding Input}"/>
            </DockPanel>
            <TextBlock Foreground="{Binding Foreground}" Text="{Binding Output}"/>
          </StackPanel>
        </DataTemplate>
      </ListBox.ItemTemplate>
    </ListBox>
  </DockPanel>
</UserControl>
