|
|
|
@ -39,7 +39,6 @@ |
|
|
|
<x:Type TypeName="core_common:ProtocolType" /> |
|
|
|
<x:Type TypeName="core_common:ProtocolType" /> |
|
|
|
</ObjectDataProvider.MethodParameters> |
|
|
|
</ObjectDataProvider.MethodParameters> |
|
|
|
</ObjectDataProvider> |
|
|
|
</ObjectDataProvider> |
|
|
|
|
|
|
|
|
|
|
|
</UserControl.Resources> |
|
|
|
</UserControl.Resources> |
|
|
|
|
|
|
|
|
|
|
|
<DockPanel> |
|
|
|
<DockPanel> |
|
|
|
@ -73,14 +72,32 @@ |
|
|
|
<MenuItem Header="_View"/> |
|
|
|
<MenuItem Header="_View"/> |
|
|
|
<MenuItem Header="_About"/> |
|
|
|
<MenuItem Header="_About"/> |
|
|
|
</Menu> |
|
|
|
</Menu> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Left Panel that holds History and Command Sets --> |
|
|
|
<StackPanel Orientation="Vertical" DockPanel.Dock="Left" Width="150"> |
|
|
|
<StackPanel Orientation="Vertical" DockPanel.Dock="Left" Width="150"> |
|
|
|
<Button Name="AddNewTabButton" Content="Add new Tab"> |
|
|
|
|
|
|
|
<Button.Resources> |
|
|
|
</StackPanel> |
|
|
|
<!-- Binding Proxy to provide DataContext to elements within ContextMenu --> |
|
|
|
|
|
|
|
<helpers:BindingProxy x:Key="proxy" Data="{Binding}"/> |
|
|
|
<!-- Grid to contain hidden add Tab Button, and the tab control --> |
|
|
|
</Button.Resources> |
|
|
|
<Grid DockPanel.Dock="Right"> |
|
|
|
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
|
|
|
<RowDefinition Height="0"/> |
|
|
|
|
|
|
|
<RowDefinition Height="*"/> |
|
|
|
|
|
|
|
</Grid.RowDefinitions> |
|
|
|
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
<ColumnDefinition Width="0"/> |
|
|
|
|
|
|
|
<ColumnDefinition Width="*"/> |
|
|
|
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Grid.Resources> |
|
|
|
|
|
|
|
<!-- Binding Proxy to provide DataContext to elements within ContextMenu --> |
|
|
|
|
|
|
|
<helpers:BindingProxy x:Key="proxy" Data="{Binding}"/> |
|
|
|
|
|
|
|
</Grid.Resources> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Button with context menu that is never visible --> |
|
|
|
|
|
|
|
<Button Visibility="Collapsed" Grid.Row="0" Grid.Column="0"> |
|
|
|
<Button.ContextMenu> |
|
|
|
<Button.ContextMenu> |
|
|
|
<ContextMenu x:Name="MainContextMenu" PlacementRectangle="{Binding RelativeSource={RelativeSource Self}}"> |
|
|
|
<ContextMenu x:Name="AddTabContextMenu" PlacementRectangle="{Binding RelativeSource={RelativeSource Self}}"> |
|
|
|
<!-- View types --> |
|
|
|
<!-- View types --> |
|
|
|
<controls:SingleSelectSubMenu Title="View type" |
|
|
|
<controls:SingleSelectSubMenu Title="View type" |
|
|
|
OptionsSource="{Binding Source={StaticResource TerminalViewTypeValues}}" |
|
|
|
OptionsSource="{Binding Source={StaticResource TerminalViewTypeValues}}" |
|
|
|
@ -89,7 +106,7 @@ |
|
|
|
</controls:SingleSelectSubMenu> |
|
|
|
</controls:SingleSelectSubMenu> |
|
|
|
|
|
|
|
|
|
|
|
<Separator/> |
|
|
|
<Separator/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Protocol types --> |
|
|
|
<!-- Protocol types --> |
|
|
|
<controls:CommandableSubMenu Title="Protocol" |
|
|
|
<controls:CommandableSubMenu Title="Protocol" |
|
|
|
OptionsSource="{Binding Source={StaticResource ProtocolTypeValues}}" |
|
|
|
OptionsSource="{Binding Source={StaticResource ProtocolTypeValues}}" |
|
|
|
@ -98,12 +115,44 @@ |
|
|
|
</controls:CommandableSubMenu> |
|
|
|
</controls:CommandableSubMenu> |
|
|
|
</ContextMenu> |
|
|
|
</ContextMenu> |
|
|
|
</Button.ContextMenu> |
|
|
|
</Button.ContextMenu> |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
|
|
|
<Button.Triggers> |
|
|
|
<custom_controls:ExtendedTabControl Grid.Row="1" Grid.Column="1" |
|
|
|
<EventTrigger SourceName="AddNewTabButton" RoutedEvent="Button.Click"> |
|
|
|
x:Name="terminalTabControl" |
|
|
|
|
|
|
|
ItemsSource="{Binding TerminalViewModels}" |
|
|
|
|
|
|
|
SelectedItem="{Binding SelectedTerminalViewModel}"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Register additional Tab ViewModels here --> |
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl.Resources> |
|
|
|
|
|
|
|
<DataTemplate DataType="{x:Type vm:SendReceiveViewModel}"> |
|
|
|
|
|
|
|
<v:SendReceiveView/> |
|
|
|
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
</custom_controls:ExtendedTabControl.Resources> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl.ItemTemplate> |
|
|
|
|
|
|
|
<!-- Tab Template --> |
|
|
|
|
|
|
|
<DataTemplate> |
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal"> |
|
|
|
|
|
|
|
<TextBlock Text="{Binding Title, Mode=OneWay}" /> |
|
|
|
|
|
|
|
<Button Command="{Binding CloseRequestCommand}" Width="20" Padding="0" Margin="8 0 0 0" Content="X"> |
|
|
|
|
|
|
|
<Button.Style> |
|
|
|
|
|
|
|
<Style TargetType="Button" x:Name="CloseButtonStyle"> |
|
|
|
|
|
|
|
<Setter Property="Visibility" Value="Visible"/> |
|
|
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/> |
|
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/> |
|
|
|
|
|
|
|
</Style> |
|
|
|
|
|
|
|
</Button.Style> |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
</custom_controls:ExtendedTabControl.ItemTemplate> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl.Triggers> |
|
|
|
|
|
|
|
<!-- Trigger that opens the context menu, listening on custom routed event AddButtonClicked --> |
|
|
|
|
|
|
|
<EventTrigger RoutedEvent="custom_controls:ExtendedTabControl.AddButtonClicked"> |
|
|
|
<BeginStoryboard> |
|
|
|
<BeginStoryboard> |
|
|
|
<Storyboard> |
|
|
|
<Storyboard> |
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainContextMenu" Storyboard.TargetProperty="(ContextMenu.IsOpen)"> |
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AddTabContextMenu" Storyboard.TargetProperty="(ContextMenu.IsOpen)"> |
|
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0"> |
|
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0"> |
|
|
|
<DiscreteObjectKeyFrame.Value> |
|
|
|
<DiscreteObjectKeyFrame.Value> |
|
|
|
<sys:Boolean>True</sys:Boolean> |
|
|
|
<sys:Boolean>True</sys:Boolean> |
|
|
|
@ -113,48 +162,8 @@ |
|
|
|
</Storyboard> |
|
|
|
</Storyboard> |
|
|
|
</BeginStoryboard> |
|
|
|
</BeginStoryboard> |
|
|
|
</EventTrigger> |
|
|
|
</EventTrigger> |
|
|
|
</Button.Triggers> |
|
|
|
</custom_controls:ExtendedTabControl.Triggers> |
|
|
|
</Button> |
|
|
|
</custom_controls:ExtendedTabControl> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
<!--<RibbonMenuButton x:Name="newTerminalMenu" Label="Add new Tab" Background="Gray"> |
|
|
|
|
|
|
|
<RibbonRadioButton Label="SendReceive"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</RibbonRadioButton> |
|
|
|
|
|
|
|
<RibbonRadioButton Label="Console"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</RibbonRadioButton> |
|
|
|
|
|
|
|
<RibbonSeparator/> |
|
|
|
|
|
|
|
</RibbonMenuButton>--> |
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl DockPanel.Dock="Right" |
|
|
|
|
|
|
|
x:Name="terminalTabControl" |
|
|
|
|
|
|
|
ItemsSource="{Binding TerminalViewModels}" |
|
|
|
|
|
|
|
SelectedItem="{Binding SelectedTerminalViewModel}"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Tab Template --> |
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl.ItemTemplate> |
|
|
|
|
|
|
|
<DataTemplate> |
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal"> |
|
|
|
|
|
|
|
<TextBlock Text="{Binding Title, Mode=OneWay}" /> |
|
|
|
|
|
|
|
<Button Command="{Binding CloseRequestCommand}" Width="20" Padding="0" Margin="8 0 0 0" Content="X"> |
|
|
|
|
|
|
|
<Button.Style> |
|
|
|
|
|
|
|
<Style TargetType="Button" x:Name="CloseButtonStyle"> |
|
|
|
|
|
|
|
<Setter Property="Visibility" Value="Visible"/> |
|
|
|
|
|
|
|
<Setter Property="Background" Value="Transparent"/> |
|
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/> |
|
|
|
|
|
|
|
</Style> |
|
|
|
|
|
|
|
</Button.Style> |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
</custom_controls:ExtendedTabControl.ItemTemplate> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Register additional Tab ViewModels here --> |
|
|
|
|
|
|
|
<custom_controls:ExtendedTabControl.Resources> |
|
|
|
|
|
|
|
<DataTemplate DataType="{x:Type vm:SendReceiveViewModel}"> |
|
|
|
|
|
|
|
<v:SendReceiveView/> |
|
|
|
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
</custom_controls:ExtendedTabControl.Resources> |
|
|
|
|
|
|
|
</custom_controls:ExtendedTabControl> |
|
|
|
|
|
|
|
</DockPanel> |
|
|
|
</DockPanel> |
|
|
|
</UserControl> |
|
|
|
</UserControl> |
|
|
|
|