-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
221 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,123 @@ | ||
<Page x:Class="llcom.Pages.SocketClientPage" | ||
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:llcom.Pages" | ||
xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI" | ||
adonisExtensions:RippleExtension.FadeInDuration="0" | ||
adonisExtensions:RippleExtension.FadeOutDuration="0" | ||
mc:Ignorable="d" | ||
d:DesignHeight="440" d:DesignWidth="400" | ||
Title="SocketClientPage" | ||
Loaded="Page_Loaded"> | ||
<Page | ||
x:Class="llcom.Pages.SocketClientPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:llcom.Pages" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title="SocketClientPage" | ||
adonisExtensions:RippleExtension.FadeInDuration="0" | ||
adonisExtensions:RippleExtension.FadeOutDuration="0" | ||
d:DesignHeight="440" | ||
d:DesignWidth="400" | ||
Loaded="Page_Loaded" | ||
mc:Ignorable="d"> | ||
<Page.Resources> | ||
<local:boolConnected x:Key="boolConnectedConverter"/> | ||
<local:boolNot x:Key="boolNotConverter"/> | ||
<local:boolVisibe x:Key="boolVisibeConverter"/> | ||
<local:boolConnected x:Key="boolConnectedConverter" /> | ||
<local:boolNot x:Key="boolNotConverter" /> | ||
<local:boolVisibe x:Key="boolVisibeConverter" /> | ||
</Page.Resources> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="auto" /> | ||
</Grid.RowDefinitions> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="auto"/> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="auto" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid IsEnabled="{Binding Changeable}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="auto" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="auto"/> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<TextBlock Text="{DynamicResource TcpServerAddr}" VerticalAlignment="Center"/> | ||
<TextBox Name="ServerTextBox" Text="{Binding tcpClientServer}" Grid.Column="1" Margin="5,0"/> | ||
<TextBlock Text="{DynamicResource TcpServerPort}" Grid.Row="1" VerticalAlignment="Center"/> | ||
<Grid Grid.Column="1" Grid.Row="1" Margin="0,3"> | ||
<TextBlock VerticalAlignment="Center" Text="{DynamicResource TcpServerAddr}" /> | ||
<TextBox | ||
Name="ServerTextBox" | ||
Grid.Column="1" | ||
Margin="5,0" | ||
Text="{Binding tcpClientServer}" /> | ||
<TextBlock | ||
Grid.Row="1" | ||
VerticalAlignment="Center" | ||
Text="{DynamicResource TcpServerPort}" /> | ||
<Grid | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
Margin="0,3"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="auto"/> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<TextBox Name="PortTextBox" Text="{Binding tcpClientPort}" Margin="5,0"/> | ||
<TextBlock Text="{DynamicResource TcpServerProtocol}" VerticalAlignment="Center" Grid.Column="1"/> | ||
<ComboBox Name="ProtocolTypeComboBox" Grid.Column="2" Margin="5,0" SelectedIndex="{Binding tcpClientProtocolType}"> | ||
<ComboBoxItem Content="TCP"/> | ||
<ComboBoxItem Content="UDP"/> | ||
<TextBox | ||
Name="PortTextBox" | ||
Margin="5,0" | ||
Text="{Binding tcpClientPort}" /> | ||
<TextBlock | ||
Grid.Column="1" | ||
VerticalAlignment="Center" | ||
Text="{DynamicResource TcpServerProtocol}" /> | ||
<ComboBox | ||
Name="ProtocolTypeComboBox" | ||
Grid.Column="2" | ||
Margin="5,0" | ||
SelectedIndex="{Binding tcpClientProtocolType}"> | ||
<ComboBoxItem Content="TCP" /> | ||
<ComboBoxItem Content="UDP" /> | ||
<ComboBoxItem Content="TCP SSL" /> | ||
</ComboBox> | ||
</Grid> | ||
</Grid> | ||
<Button Name="ConnectButton" Content="{DynamicResource ConnectButton}" Grid.Column="1" Click="ConnectButton_Click"/> | ||
<Button Name="DisconnectButton" Content="{DynamicResource DisconnectButton}" Grid.Column="1" Click="DisconnectButton_Click" | ||
Visibility="{Binding IsConnected,Converter={StaticResource boolVisibeConverter}}"/> | ||
<Button | ||
Name="ConnectButton" | ||
Grid.Column="1" | ||
Click="ConnectButton_Click" | ||
Content="{DynamicResource ConnectButton}" /> | ||
<Button | ||
Name="DisconnectButton" | ||
Grid.Column="1" | ||
Click="DisconnectButton_Click" | ||
Content="{DynamicResource DisconnectButton}" | ||
Visibility="{Binding IsConnected, Converter={StaticResource boolVisibeConverter}}" /> | ||
</Grid> | ||
|
||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.ColumnSpan="3"> | ||
<TextBlock Text="{DynamicResource ToSendDataTextBlock}" VerticalAlignment="Center"/> | ||
<CheckBox Content="Hex" IsChecked="{Binding HexMode}" Grid.Row="2" HorizontalAlignment="Left" Margin="2" | ||
VerticalAlignment="Center"/> | ||
<StackPanel | ||
Grid.Row="1" | ||
Grid.ColumnSpan="3" | ||
Orientation="Horizontal"> | ||
<TextBlock VerticalAlignment="Center" Text="{DynamicResource ToSendDataTextBlock}" /> | ||
<CheckBox | ||
Grid.Row="2" | ||
Margin="2" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Content="Hex" | ||
IsChecked="{Binding HexMode}" /> | ||
</StackPanel> | ||
<TextBox Name="ToSendTextBox" VerticalContentAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" | ||
VerticalScrollBarVisibility="Auto" FontFamily="Consolas" Grid.Row="2" Margin="0,3,0,0"/> | ||
<Button Name="SendButton" Content="{DynamicResource NetSendDataButton}" Grid.Row="3" HorizontalAlignment="Right" Margin="0,5,0,0" | ||
Click="SendButton_Click"/> | ||
<TextBox | ||
Name="ToSendTextBox" | ||
Grid.Row="2" | ||
Margin="0,3,0,0" | ||
VerticalContentAlignment="Top" | ||
AcceptsReturn="True" | ||
FontFamily="Consolas" | ||
TextWrapping="Wrap" | ||
VerticalScrollBarVisibility="Auto" /> | ||
<Button | ||
Name="SendButton" | ||
Grid.Row="3" | ||
Margin="0,5,0,0" | ||
HorizontalAlignment="Right" | ||
Click="SendButton_Click" | ||
Content="{DynamicResource NetSendDataButton}" /> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters