71 lines
3.3 KiB
XML
71 lines
3.3 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"
|
|
xmlns:converters="clr-namespace:Qrakhen.Qamp.Editor.Converters"
|
|
mc:Ignorable="d"
|
|
Background="#222324"
|
|
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="48" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<ListBox x:Name="LineNumbers"
|
|
Grid.Column="0"
|
|
ItemsSource="{Binding Lines.Count, Converter={StaticResource LineCountConverter}}"
|
|
IsHitTestVisible="False"
|
|
Background="#101112"
|
|
Foreground="#92989f"
|
|
BorderThickness="0"
|
|
Padding="0"
|
|
Margin="0,-2,0,0"
|
|
VerticalContentAlignment="Top"
|
|
HorizontalContentAlignment="Right">
|
|
<ListBox.ItemTemplate>
|
|
<ItemContainerTemplate>
|
|
<TextBlock Height="14"
|
|
LineHeight="18"
|
|
Margin="0"
|
|
Padding="0"
|
|
FontFamily="Consolas"
|
|
FontSize="14"
|
|
Text="{Binding}"></TextBlock>
|
|
</ItemContainerTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<ItemsControl x:Name="LineList"
|
|
Padding="3,0,0,0"
|
|
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>
|