@ -97,11 +97,6 @@
</StatusBar>
<Separator DockPanel.Dock="Bottom" Margin="0 5 0 5"/>
<!-- Left Panel that holds History and Command Sets -->
<StackPanel Orientation="Vertical" DockPanel.Dock="Left" Width="150">
</StackPanel>
<!-- Grid to contain hidden add Tab Button, and the tab control -->
<Grid DockPanel.Dock="Right">
<Grid.RowDefinitions>
@ -109,8 +104,8 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0 "/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1* "/>
<ColumnDefinition Width="6 *" MinWidth="1200 "/>
</Grid.ColumnDefinitions>
<Grid.Resources>
@ -141,6 +136,56 @@
</Button.ContextMenu>
</Button>
<!-- Left Panel that holds History and Command Sets -->
<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="0" Width="Auto">
<GroupBox Header="Send History">
<!-- History -->
<ListView x:Name="historyListView"
ItemsSource="{Binding Path=SelectedTerminalViewModel.SentMessagesHistory}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<!-- Hide ListView if there are no items -->
<ListView.Style>
<Style TargetType="{x:Type ListView}">
<Setter Property="Visibility" Value="Visible"/>
<Style.Triggers>
<!-- Collapsed when no history available (0 items, fallback 1, to not hide it on error) -->
<DataTrigger Binding="{Binding Path=SelectedTerminalViewModel.SentMessagesHistory.Count, FallbackValue=1, TargetNullValue=1}" Value="0">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ListView.Style>
<!-- Make items non-selectable and stretch -->
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Focusable" Value="false"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
<!-- Template for item -->
<ListView.ItemTemplate>
<DataTemplate>
<DockPanel LastChildFill="False" HorizontalAlignment="Stretch">
<TextBlock DockPanel.Dock="Left" Text="{Binding DisplayText}"
VerticalAlignment="Center"/>
<!-- Button Command binds with DataContext of historyListView, CommandParameter binds with the item -->
<Button DockPanel.Dock="Right" ToolTip="Insert"
Command="{Binding Path=DataContext.SelectedTerminalViewModel.InsertElementFromHistoryCommand, ElementName=historyListView}"
CommandParameter="{Binding}">
<Image Source="/Assets/mdi-import.png" Width="20" Margin="0"/>
</Button>
</DockPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</GroupBox>
</StackPanel>
<!-- Splitter between two parts of UI -->
<GridSplitter Grid.Column="0" Grid.RowSpan="2" Width="2.5" Background="LightGray"/>
<!-- Tab control -->
<custom_controls:ExtendedTabControl Grid.Row="1" Grid.Column="1"
x:Name="terminalTabControl"
IsSynchronizedWithCurrentItem="True"