Multiprocotol Terminalprogram (BAT)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MultiTerm/MultiTerm.Wpf/View/SendReceiveView.xaml

90 lines
4.8 KiB

<UserControl x:Class="MultiTerm.Wpf.View.SendReceiveView"
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:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:MultiTerm.Wpf.View"
xmlns:conv="clr-namespace:MultiTerm.Wpf.ValueConverters"
xmlns:protocol_serial="clr-namespace:MultiTerm.Protocols.Serial;assembly=MultiTerm.Protocols"
xmlns:types="clr-namespace:MultiTerm.Core.Types;assembly=MultiTerm.Core"
xmlns:settings_view="clr-namespace:MultiTerm.Wpf.View.SettingsView"
xmlns:custom_controls="clr-namespace:MultiTerm.Wpf.CustomControl;assembly=MultiTerm.Wpf.CustomControl"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<!-- Value Converters -->
<conv:EnumValueToEnumDescriptionConverter x:Key="EnumValToDescConverter"/>
<!-- Data Sources -->
<ObjectDataProvider x:Key="NewlineSeparatorTypeValues"
ObjectType="{x:Type sys:Enum}"
MethodName="GetValues">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="types:NewlineSeparatorType" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50px"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<!-- Settings View Model -->
<GroupBox Header="Protocol Settings" Grid.Row="0" Grid.Column="0" Padding="5 1">
<!-- Register additional Settings ViewModels here -->
<ContentControl Content="{Binding ProtocolSettings}">
<ContentControl.Resources>
<DataTemplate DataType="{x:Type protocol_serial:SerialProtocolSettingsViewModel}">
<settings_view:SerialSettingsView/>
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
</GroupBox>
<GroupBox Header="Receive" Grid.Row="1" Padding="5">
<custom_controls:MultiFormatDataView x:Name="mfdvReceive"
DataSource="{Binding ReceivedData}"
SelectorItemsSource="{Binding Source={StaticResource NewlineSeparatorTypeValues}, Converter={StaticResource EnumValToDescConverter}}"
SelectorSelectedItem="{Binding Path=ReceivedData.NewlineSeparator, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource EnumValToDescConverter}}"
SelectorDescription="Newline Separator">
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="ClearRequested" SourceObject="{Binding ElementName=mfdvReceive}">
<behaviors:InvokeCommandAction Command="{Binding ReceivedData.ClearCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</custom_controls:MultiFormatDataView>
</GroupBox>
<GroupBox Header="Send" Grid.Row="2" Padding="5">
<DockPanel>
<!-- Send text box -->
<DockPanel DockPanel.Dock="Top" LastChildFill="True">
<Button DockPanel.Dock="Right" Content="Send" Command="{Binding SendCommand}"/>
<custom_controls:MultiFormatTextBox x:Name="sendTextBox" DockPanel.Dock="Left"
CurrentMultiFormatString="{Binding Path=SendableData, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="EnterPressed" SourceObject="{Binding ElementName=sendTextBox}">
<behaviors:InvokeCommandAction Command="{Binding SendCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</custom_controls:MultiFormatTextBox>
</DockPanel>
<Separator/>
<TextBox DockPanel.Dock="Bottom" Text="{Binding TempSentDataString}">
</TextBox>
</DockPanel>
</GroupBox>
</Grid>
</UserControl>