You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
4.0 KiB
XML
68 lines
4.0 KiB
XML
<Window x:Class="SocketExample.MultiClientsWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:SocketExample"
|
|
mc:Ignorable="d"
|
|
Title="MultiClientsWindow" Height="450" Width="800">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10">
|
|
<TextBlock Text="Panel生成数量:" VerticalAlignment="Center" Margin="0,0,10,0"/>
|
|
<TextBox x:Name="CountTextBox" Width="100" Margin="0,0,10,0"/>
|
|
<Button Content="生成" Click="GenerateButton_Click" Padding="10,5"/>
|
|
<Button Content="清空" Click="ClearButton_Click" Padding="10,5" Margin="10 0 0 0"/>
|
|
</StackPanel>
|
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl x:Name="PanelContainer">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal"></WrapPanel>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Vertical" Margin="5 5 5 5" Width="370" Height="400">
|
|
<Border Width="Auto" Background="LightSkyBlue" >
|
|
<TextBlock Width="Auto" Text="{Binding Text}"></TextBlock>
|
|
</Border>
|
|
<StackPanel Orientation="Horizontal" Width="360">
|
|
<Label Content="IP地址" Height="30" Margin="10 8 0 0"/>
|
|
<TextBox TextWrapping="Wrap" x:Name="IPtextbox" Text="{Binding IPtext}" Width="75" Height="30" Margin="10 8 0 0"/>
|
|
<Label Content="端口号" Height="30" Margin="10 8 0 0"/>
|
|
<TextBox TextWrapping="Wrap" Text="{Binding Porttext}" x:Name="Porttextbox" MinWidth="40" Height="30" Margin="10 8 0 0"/>
|
|
<Button Content="链接" Height="30" Margin="10 8 0 0" Command="{Binding _linkcomn}"/>
|
|
<Button Content="清空" Height="30" Margin="10 8 0 0" Command="{Binding _clearcomn}"/>
|
|
<Button Content="断开" Height="30" Margin="10 8 10 0" Command="{Binding _disconnectcomn}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" Width="360" Margin="0,5,0,5" Height="250">
|
|
<Border Height="Auto" Width="200" BorderBrush="Black" BorderThickness="0.5" Margin="5,5,10,0" >
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<TextBlock x:Name="InfoTextBlock_Client" TextWrapping="Wrap" Text="{Binding Infotext}" Height="Auto" Width="Auto" Margin="5,5,5,5"></TextBlock>
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<StackPanel Orientation="Vertical" Margin="0,5,0,0" Width="140">
|
|
<TextBox TextWrapping="Wrap" x:Name="MessageTextBox_Client" Text="{Binding MessageText}" Height="200" Margin="0,0,0,10"/>
|
|
<Button Content="发送" Width="50" HorizontalAlignment="Center" Command="{Binding _sendcomn}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
</Window>
|