qamp/Qrakhen.Qamp.Editor/Controls/EditorFrame.xaml

55 lines
2.5 KiB
XML

<UserControl x:Class="Qrakhen.Qamp.Editor.Controls.EditorFrame"
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:Qrakhen.Qamp.Editor.Controls"
mc:Ignorable="d"
Background="#161718"
Focusable="True"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Style>
<Style TargetType="{x:Type local:EditorFrame}">
<Setter Property="CursorPosition" Value="{Binding CursorPosition}" />
<Setter Property="CurrentSelection" Value="{Binding CurrentSelection}" />
<Setter Property="CurrentLineBuffer" Value="{Binding CurrentLineBuffer}" />
</Style>
</UserControl.Style>
<ScrollViewer x:Name="ScrollView"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ListBox x:Name="LinesList"
Grid.Column="0"
ItemsSource="{Binding Lines.Count}"
IsHitTestVisible="False"
Background="#121314"
Foreground="#969696"
BorderThickness="0"
Padding="0,0,5,0"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Right"/>
<ItemsControl ItemsSource="{Binding Lines}"
Grid.Column="1">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<local:LineRenderer LineBuffer="{Binding Buffer}"
Selection="{Binding Selection}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
</UserControl>