|
|
|
|
@ -18,7 +18,8 @@ |
|
|
|
|
d:DesignHeight="600" d:DesignWidth="1200"> |
|
|
|
|
<UserControl.Resources> |
|
|
|
|
<!-- Value Converters --> |
|
|
|
|
<conv:EnumDescriptionToMenuItemConverter x:Key="EnumDescriptionConverter"/> |
|
|
|
|
<conv:EnumDescriptionToMenuItemConverter x:Key="EnumDescriptionToMenuItemConverter"/> |
|
|
|
|
<conv:EnumValueToEnumDescriptionConverter x:Key="EnumValToDescConv"/> |
|
|
|
|
<conv:MessageImportanceToBrushConverter x:Key="MsgImportanceBrushConverter"/> |
|
|
|
|
<conv:MessageImportanceToFontWeightConverter x:Key="MsgImportanceFontWeightConverter"/> |
|
|
|
|
<conv:ProtocolTypeToIconConverter x:Key="ProtocolTypeIconConverter"/> |
|
|
|
|
@ -66,11 +67,11 @@ |
|
|
|
|
<MenuItem Header="_Settings"> |
|
|
|
|
<controls:SingleSelectSubMenu Title="Default Data Display Newline Separator" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" |
|
|
|
|
OptionsSource="{Binding Source={StaticResource NewlineSeparatorTypeValues}}" |
|
|
|
|
SelectedMenuItem="{Binding DefaultReceiveNewlineSeparator, Mode=TwoWay, Converter={StaticResource EnumDescriptionConverter}}"> |
|
|
|
|
SelectedMenuItem="{Binding DefaultReceiveNewlineSeparator, Mode=TwoWay, Converter={StaticResource EnumDescriptionToMenuItemConverter}}"> |
|
|
|
|
</controls:SingleSelectSubMenu> |
|
|
|
|
<controls:SingleSelectSubMenu Title="Default Newline Separator on Send" |
|
|
|
|
OptionsSource="{Binding Source={StaticResource NewlineSeparatorTypeValues}}" |
|
|
|
|
SelectedMenuItem="{Binding DefaultSendNewlineSeparator, Mode=TwoWay, Converter={StaticResource EnumDescriptionConverter}}"> |
|
|
|
|
SelectedMenuItem="{Binding DefaultSendNewlineSeparator, Mode=TwoWay, Converter={StaticResource EnumDescriptionToMenuItemConverter}}"> |
|
|
|
|
</controls:SingleSelectSubMenu> |
|
|
|
|
</MenuItem> |
|
|
|
|
<!--<MenuItem Header="_View"/>--> |
|
|
|
|
@ -121,7 +122,7 @@ |
|
|
|
|
<controls:SingleSelectSubMenu Title="View type" |
|
|
|
|
OptionsSource="{Binding Source={StaticResource TerminalViewTypeValues}}" |
|
|
|
|
SelectedMenuItem="{Binding Data.SelectedTerminalViewType, Mode=TwoWay, Source={StaticResource proxy}, |
|
|
|
|
Converter={StaticResource EnumDescriptionConverter}}"> |
|
|
|
|
Converter={StaticResource EnumDescriptionToMenuItemConverter}}"> |
|
|
|
|
</controls:SingleSelectSubMenu> |
|
|
|
|
|
|
|
|
|
<Separator/> |
|
|
|
|
@ -140,7 +141,8 @@ |
|
|
|
|
<DockPanel Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Width="Auto"> |
|
|
|
|
<GroupBox Header="Send History" DockPanel.Dock="Top"> |
|
|
|
|
<!-- History --> |
|
|
|
|
<ListView x:Name="historyListView" Height="{Binding Path=ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type StackPanel}}}" |
|
|
|
|
<ListView x:Name="historyListView" |
|
|
|
|
Height="{Binding Path=ActualHeight, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type StackPanel}}}" |
|
|
|
|
ItemsSource="{Binding Path=SelectedTerminalViewModel.SentMessagesHistory}" |
|
|
|
|
VerticalContentAlignment="Top" |
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
|
|
|
|
@ -188,7 +190,7 @@ |
|
|
|
|
<GridSplitter Grid.Column="0" Grid.RowSpan="2" Width="2.5" Background="LightGray"/> |
|
|
|
|
|
|
|
|
|
<!-- Tab control --> |
|
|
|
|
<custom_controls:ExtendedTabControl Grid.Row="1" Grid.Column="1" |
|
|
|
|
<custom_controls:ExtendedTabControl Grid.Row="1" Grid.Column="1" Panel.ZIndex="0" |
|
|
|
|
x:Name="terminalTabControl" |
|
|
|
|
IsSynchronizedWithCurrentItem="True" |
|
|
|
|
behaviours:TabContent.IsCached="True" |
|
|
|
|
@ -219,11 +221,11 @@ |
|
|
|
|
<Ellipse Width="16" Height="16" Margin="0 0 8 0" |
|
|
|
|
Stroke="Black" StrokeThickness="0.7" |
|
|
|
|
Fill="{Binding Path=CommunicationProtocolConnectionState, Converter={StaticResource PrtclConnectionStateBrushConverter}}" |
|
|
|
|
ToolTip="{Binding Path=CommunicationProtocolConnectionState, Converter={StaticResource EnumDescriptionConverter}}" |
|
|
|
|
ToolTip="{Binding Path=CommunicationProtocolConnectionState, Converter={StaticResource EnumValToDescConv}}" |
|
|
|
|
ToolTipService.InitialShowDelay="200"/> |
|
|
|
|
<Image Height="17" Stretch="Fill" Margin="0 0 8 0" |
|
|
|
|
Source="{Binding Path=ProtocolType, Converter={StaticResource ProtocolTypeIconConverter}}" |
|
|
|
|
ToolTip="{Binding Path=ProtocolType,Converter={StaticResource EnumDescriptionConverter}}" |
|
|
|
|
ToolTip="{Binding Path=ProtocolType,Converter={StaticResource EnumValToDescConv}}" |
|
|
|
|
ToolTipService.InitialShowDelay="200"/> |
|
|
|
|
<TextBlock Text="{Binding Title, Mode=OneWay}" |
|
|
|
|
ToolTip="{Binding Path=CommunicationProtocolLongIdentifier}" |
|
|
|
|
@ -258,6 +260,85 @@ |
|
|
|
|
</EventTrigger> |
|
|
|
|
</custom_controls:ExtendedTabControl.Triggers> |
|
|
|
|
</custom_controls:ExtendedTabControl> |
|
|
|
|
|
|
|
|
|
<!-- Start Menu --> |
|
|
|
|
<Border Grid.Row="1" Grid.Column="1" Width="400" Height="300" |
|
|
|
|
BorderThickness="1" BorderBrush="Black" CornerRadius="10" |
|
|
|
|
Panel.ZIndex="1"> |
|
|
|
|
<Border.Style> |
|
|
|
|
<Style TargetType="{x:Type Border}"> |
|
|
|
|
<Setter Property="Visibility" Value="Collapsed"/> |
|
|
|
|
<Style.Triggers> |
|
|
|
|
<!-- Visible only when no tabs are available (0 items, fallback 0, to hide it on error) --> |
|
|
|
|
<DataTrigger Binding="{Binding Path=TerminalViewModels.Count, FallbackValue=0, TargetNullValue=0}" Value="0"> |
|
|
|
|
<Setter Property="Visibility" Value="Visible"/> |
|
|
|
|
</DataTrigger> |
|
|
|
|
</Style.Triggers> |
|
|
|
|
</Style> |
|
|
|
|
</Border.Style> |
|
|
|
|
<!-- Content --> |
|
|
|
|
<DockPanel LastChildFill="False"> |
|
|
|
|
<!-- Intro --> |
|
|
|
|
<StackPanel DockPanel.Dock="Top" Margin="10" |
|
|
|
|
Orientation="Vertical"> |
|
|
|
|
<TextBlock Text="Start menu" |
|
|
|
|
FontSize="20" FontWeight="SemiBold"/> |
|
|
|
|
<TextBlock Text="Welcome to MultiTerm. To open a Terminal, please select View type and Protocol below." |
|
|
|
|
TextWrapping="Wrap"/> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Left side--> |
|
|
|
|
<StackPanel Orientation="Vertical" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="40 10"> |
|
|
|
|
<Label Content="View type:"/> |
|
|
|
|
<!-- Terminal View Types as ListBox, styled as RadioButton --> |
|
|
|
|
<ListBox BorderBrush="Transparent" |
|
|
|
|
ItemsSource="{Binding Source={StaticResource TerminalViewTypeValues}, Converter={StaticResource EnumValToDescConv}}" |
|
|
|
|
SelectedItem="{Binding SelectedTerminalViewType, Mode=TwoWay, Converter={StaticResource EnumValToDescConv}}"> |
|
|
|
|
<ListBox.Resources> |
|
|
|
|
<Style TargetType="{x:Type ListBoxItem}"> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate> |
|
|
|
|
<RadioButton |
|
|
|
|
Content="{TemplateBinding ContentPresenter.Content}" |
|
|
|
|
IsChecked="{Binding Path=IsSelected, |
|
|
|
|
RelativeSource={RelativeSource TemplatedParent}, |
|
|
|
|
Mode=TwoWay}"/> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
</ListBox.Resources> |
|
|
|
|
</ListBox> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Right side--> |
|
|
|
|
<StackPanel Orientation="Vertical" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="40 10"> |
|
|
|
|
<Label Content="Protocol type:"/> |
|
|
|
|
<!-- ListBox with Protocol types--> |
|
|
|
|
<ListBox BorderBrush="Transparent" |
|
|
|
|
ItemsSource="{Binding Source={StaticResource ProtocolTypeValues}, Converter={StaticResource EnumValToDescConv}}" |
|
|
|
|
x:Name="listBoxStartMenuProtocols"> |
|
|
|
|
<ListBox.Resources> |
|
|
|
|
<Style TargetType="{x:Type ListBoxItem}"> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate> |
|
|
|
|
<!-- Button Command binds with DataContext of parent ListBox, CommandParameter binds with the item --> |
|
|
|
|
<Button Margin="0 2" |
|
|
|
|
Content="{TemplateBinding ContentPresenter.Content}"> |
|
|
|
|
<!--Command="{Binding Path=DataContext.AppendTerminalWithSelectedViewTypeTestCommand, ElementName=listBoxStartMenuProtocols}" |
|
|
|
|
CommandParameter="{Binding Path=., Converter={helpers:Inverted {StaticResource EnumValToDescConv}}}">--> |
|
|
|
|
</Button> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
</ListBox.Resources> |
|
|
|
|
</ListBox> |
|
|
|
|
</StackPanel> |
|
|
|
|
</DockPanel> |
|
|
|
|
</Border> |
|
|
|
|
</Grid> |
|
|
|
|
</DockPanel> |
|
|
|
|
</UserControl> |
|
|
|
|
|