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.
540 lines
47 KiB
XML
540 lines
47 KiB
XML
<Window x:Class="SocketExample.TCPWindowV2"
|
|
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:controls="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
|
|
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
|
xmlns:local="clr-namespace:SocketExample"
|
|
mc:Ignorable="d"
|
|
Title="RFID读写器多终端监控软件v1.093" Height="680" Width="1180"
|
|
Background="Transparent" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterScreen">
|
|
|
|
<Window.Resources>
|
|
<Style x:Key="SocketButton" TargetType="Button" BasedOn="{StaticResource BaseButtonStyle}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border x:Name="ButtonBorder" CornerRadius="3">
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<GradientStop Color="#FF4A90E2" Offset="0"/>
|
|
<GradientStop Color="#FF1E62D0" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="ButtonBorder" Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<GradientStop Color="#FF5D9CEC" Offset="0"/>
|
|
<GradientStop Color="#FF2D76DB" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="ButtonBorder" Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<GradientStop Color="#FF3D7BC8" Offset="0"/>
|
|
<GradientStop Color="#FF0D4BB6" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Window.Resources>
|
|
|
|
<Border CornerRadius="30" BorderThickness="2" BorderBrush="#ebedf3" Padding="10" MouseDown="Border_MouseDown" Background="#FFCFD5E5">
|
|
<Border CornerRadius="30">
|
|
<Border.Background>
|
|
<LinearGradientBrush>
|
|
<GradientStop Color="#fefefe" Offset="0"/>
|
|
<GradientStop Color="#ededef" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<Border CornerRadius="30">
|
|
<!--
|
|
<Border.Background>
|
|
<DrawingBrush Opacity="0.2" TileMode="Tile" Viewport="0,0,300,80" ViewportUnits="Absolute">
|
|
<DrawingBrush.Transform>
|
|
<RotateTransform Angle="-45" CenterX="0" CenterY="0"/>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<DrawingGroup>
|
|
<GeometryDrawing Brush="Transparent">
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="30,70,300,300"/>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
<ImageDrawing ImageSource="/海威图标-横.png" Rect="5,5,100,100"/>
|
|
</DrawingGroup>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Border.Background>
|
|
-->
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="90"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" CornerRadius="20" Background="{StaticResource PrimaryBrush}" Margin="10">
|
|
<Grid>
|
|
<TextBlock Text="RFID设备监控平台" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="38" FontWeight="SemiBold"/>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="400"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Column="0" >
|
|
<StackPanel x:Name="Welcome_StackPanel" Orientation="Horizontal" Visibility="Hidden">
|
|
<Button x:Name="CreateTerminal_Button" Height="40" Width="50" Margin="10 0 0 0" Style="{StaticResource FlatButton}" Click="CreateTerminal_Button_Click">
|
|
<Image Source="/新增.png"/>
|
|
</Button>
|
|
<Image Source="/海威图标-横.png" Margin="2 14 14 13"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel x:Name="NewTerminal_StackPanel" Orientation="Horizontal" Margin="10 0 0 0" VerticalAlignment="Center">
|
|
<TextBlock Text="监控终端生成数量:" VerticalAlignment="Center" Margin="0,0,10,0" Foreground="White" FontSize="15" FontWeight="SemiBold"/>
|
|
<TextBox x:Name="CountTextBox" Width="100" Margin="0,0,10,0" VerticalAlignment="Center" FontSize="15" FontWeight="SemiBold"/>
|
|
<Button Content="生成" Click="GenerateButton_Click" Height="40" Width="50" Margin="10 0 0 0" Style="{StaticResource FlatButton}"/>
|
|
<Button Content="清空" Click="ClearButton_Click" Height="40" Width="50" Margin="10 0 0 0" Style="{StaticResource FlatButton}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Grid.Column="1" HorizontalAlignment="Right" Margin="0 0 10 0" VerticalAlignment="Center">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Button x:Name="Minimize_Button" Grid.Column="0" Height="40" Width="50" Style="{StaticResource FlatButton}" Margin="0 0 0 0" Click="Minimize_Button_Click">
|
|
<Image Source="/减号.png" />
|
|
</Button>
|
|
<Button x:Name="Maxmize_Button" Grid.Column="1" Height="40" Width="50" Style="{StaticResource FlatButton}" Margin="0 0 0 0" Click="Maxmize_Button_Click">
|
|
<Image x:Name="MaxMinImage" Source="/全屏.png"/>
|
|
</Button>
|
|
<Button x:Name="Shutdown_Button" Grid.Column="2" Height="40" Width="50" Style="{StaticResource FlatButton}" Click="Shutdown_Button_Click">
|
|
<Image Source="/关闭.png"/>
|
|
</Button>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
|
|
|
<ItemsControl x:Name="PanelContainer">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal"></WrapPanel>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Style="{StaticResource TerminalStyle}" Width="{Binding Borderwidth}">
|
|
<StackPanel Orientation="Vertical" Margin="5 5 5 5" >
|
|
<Border Width="Auto" Background="LightSkyBlue" CornerRadius="6" Padding="3">
|
|
<TextBox Width="Auto" Foreground="Black" Background="LightSkyBlue" Text="{Binding Text}" BorderThickness="0" FontSize="15" FontWeight="SemiBold"></TextBox>
|
|
</Border>
|
|
<StackPanel Orientation="Horizontal" Margin="5 1 5 1">
|
|
<StackPanel Orientation="Vertical">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Label Content="IP地址" Height="30" Margin="10 8 0 0" FontWeight="SemiBold"/>
|
|
<TextBox TextWrapping="Wrap" x:Name="IPtextbox" Text="{Binding IPtext}" Width="100" Height="20" Margin="5 8 0 0"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Label Content="端口号" Height="30" Margin="10 8 0 0" FontWeight="SemiBold"/>
|
|
<TextBox TextWrapping="Wrap" Text="{Binding Porttext}" x:Name="Porttextbox" Width="45" Height="20" Margin="5 8 0 0"/>
|
|
<!-- <Button Content="读取" Height="20" Width="40" Margin="10 8 0 0" Command="{Binding _readcomn}" Style="{StaticResource SocketButton}"/>-->
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<Ellipse Width="20" Height="20" Fill="{Binding StateColour}" Margin="8 8 0 0"/>
|
|
<Label Height="30" Content="{Binding LinkState}" Margin="2 8 0 0"></Label>
|
|
<Button Content="{Binding LinkButtonText}" Height="30" Width="45" Margin="10 8 0 0" Command="{Binding _linkcomn}" Style="{StaticResource SocketButton}"/>
|
|
<Button Content="清空" Height="30" Width="45" Margin="10 8 0 0" Command="{Binding _clearcomn}" Style="{StaticResource SocketButton}"/>
|
|
<!--<Button Content="断开" Height="30" Margin="10 8 10 0" Command="{Binding _disconnectcomn}" Style="{StaticResource SocketButton}"/>-->
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,1,0,5" Height="100">
|
|
<Border Height="Auto" Width="200" BorderBrush="Black" BorderThickness="1" Margin="5,2,10,0" >
|
|
<ScrollViewer x:Name="TextScrollViewer" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
|
<TextBox x:Name="InfoTextBlock_Client" TextWrapping="Wrap" BorderThickness="0" IsReadOnly="True" Text="{Binding Infotext}" Height="Auto" Width="Auto">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="TextChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding TextChangedCommand}"
|
|
CommandParameter="{Binding ElementName=TextScrollViewer}"
|
|
/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</TextBox>
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<StackPanel Orientation="Vertical" Margin="0,2,0,0">
|
|
<TextBlock Text="请输入需要发送的内容:" FontWeight="SemiBold"></TextBlock>
|
|
<TextBox TextWrapping="Wrap" x:Name="MessageTextBox_Client" Text="{Binding MessageText}" Height="50" Width="140" Margin="0,0,0,1"/>
|
|
<Button Content="发送" Width="40" Height="22" Command="{Binding _sendcomn}" Style="{StaticResource SocketButton}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" Margin="0.5 0.1 0.5 0.1" Height="150" >
|
|
<StackPanel Orientation="Vertical" MaxWidth="800">
|
|
<ItemsControl ItemsSource="{Binding TagItems}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal"></WrapPanel>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border BorderThickness="0.5" CornerRadius="10" BorderBrush="Black" Padding="2.5 3 2.5 3" Margin="0.5 1 0.5 1">
|
|
<!--<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden">-->
|
|
<Grid Margin="0.5">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="0 0 3 0" HorizontalAlignment="Left">
|
|
<Label Content="标签:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding EPCinfo}" FontSize="15" FontWeight="Bold" Foreground="{Binding InfoColor}" VerticalAlignment="Center" FontFamily="Tahoma"></TextBlock>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0 0 3 0">
|
|
<Label Content="HEX:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding EPCASC}" VerticalAlignment="Center" FontFamily="Tahoma"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0 0 3 0">
|
|
<Label Content="RSSI:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding RSSIinfo}" VerticalAlignment="Center" FontFamily="Tahoma"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="3" Orientation="Horizontal" Margin="0 0 3 0">
|
|
<Label Margin="5 0 0 0" Content="Count:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding Countinfo}" VerticalAlignment="Center" FontFamily="Tahoma"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="4" Orientation="Horizontal">
|
|
<Label Margin="5 0 0 0" Content="Time:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding Timeinfo}" VerticalAlignment="Center" FontFamily="Tahoma"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
<!--</ScrollViewer>-->
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<!--触发动作部分-->
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<StackPanel Orientation="Horizontal" Margin="1 2 1 2">
|
|
<Label Content="触发动作:" FontWeight="Bold" FontSize="13"/>
|
|
<TextBox Text="{Binding ActionType}" Width="70" TextAlignment="Center" VerticalContentAlignment="Center" FontSize="13"/>
|
|
<ComboBox x:Name="TextComboBox" Width="20" Height="25" ItemsSource="{Binding SendTextComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SendTextChangedCommand}"
|
|
CommandParameter="{Binding ElementName=TextComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="时间段:" FontWeight="Bold" FontSize="13"/>
|
|
<TextBox Text="{Binding TimeOut}" Width="50" TextAlignment="Center" VerticalContentAlignment="Center" FontSize="13"/>
|
|
<Button Content="发送" Width="50" Margin="15 2 0 2" Command="{Binding _sendactioncomn}" Style="{StaticResource SocketButton}"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 功率部分,已备份,注释后不再生成该部分
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Grid Margin="0 0 0 0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border BorderBrush="Black" BorderThickness="0.5" Grid.Row="0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Label Content="功率状态" FontSize="14" FontWeight="Bold" FontStyle="Oblique" HorizontalAlignment="Center" Grid.Row="0"/>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0 1 0 1" Grid.Row="1">
|
|
<Label Content="读:" FontSize="14"/>
|
|
<Label Content="端①:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port1ReadText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port1ReadComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port1ReadComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端②:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port2ReadText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port2ReadComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}" >
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port2ReadComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端③:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port3ReadText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port3ReadComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port3ReadComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端④:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port4ReadText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port4ReadComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port4ReadComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0 1 0 1" Grid.Row="2">
|
|
<Label Content="写:" FontSize="14"/>
|
|
<Label Content="端①:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port1WriteText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port1WriteComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port1WriteComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端②:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port2WriteText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port2WriteComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port2WriteComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端③:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port3WriteText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port3WriteComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port3WriteComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
<Label Content="端④:" FontSize="14"/>
|
|
<TextBox Text="{Binding Port4WriteText}" Width="20" Height="20" VerticalAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
<ComboBox x:Name="Port4WriteComboBox" Width="20" Height="20" ItemsSource="{Binding PortComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding SelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=Port4WriteComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0 1 0 3" Grid.Row="3">
|
|
<Button Content="设置功率" Command="{Binding _setpowercomn}" Width="50" Height="25" Margin="100 0 0 0" Style="{StaticResource SocketButton}" />
|
|
<Button Content="获取功率" Command="{Binding _getpowercomn}" Width="50" Height="25" Margin="60 0 0 0" Style="{StaticResource SocketButton}" />
|
|
</StackPanel>
|
|
|
|
|
|
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
</Border>
|
|
-->
|
|
<!--gpio部分-->
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Grid Margin="0 0 0 2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Label Grid.Row="0" HorizontalAlignment="Center" Content="GPIO状态" FontSize="14" FontWeight="Bold" FontStyle="Oblique"></Label>
|
|
<Grid Grid.Row="2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
<Label Content="GPO1" HorizontalAlignment="Left"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPO1}"></Label>
|
|
</Border>
|
|
<ComboBox x:Name="GPO1ComboBox" Width="20" Height="25" ItemsSource="{Binding GPOComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding GPOSelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=GPO1ComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
<Label Content="GPO2" HorizontalAlignment="Left"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPO2}"></Label>
|
|
</Border>
|
|
<ComboBox x:Name="GPO2ComboBox" Width="20" Height="25" ItemsSource="{Binding GPOComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding GPOSelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=GPO2ComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
|
<Label Content="GPO3" HorizontalAlignment="Left"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPO3}"></Label>
|
|
</Border>
|
|
<ComboBox x:Name="GPO3ComboBox" Width="20" Height="25" ItemsSource="{Binding GPOComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding GPOSelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=GPO3ComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="3" Orientation="Horizontal">
|
|
<Label Content="GPO4" HorizontalAlignment="Left"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPO4}"></Label>
|
|
</Border>
|
|
<ComboBox x:Name="GPO4ComboBox" Width="20" Height="25" ItemsSource="{Binding GPOComboBox,Mode=TwoWay}">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction
|
|
Command="{Binding GPOSelectionChangedCommand}"
|
|
CommandParameter="{Binding ElementName=GPO4ComboBox}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Margin="0 0 0 5">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
<Label Content="GPI1" HorizontalAlignment="Left" Margin="0 0 6 0"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPI1}" >
|
|
<!-- 标签修改事件
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="">
|
|
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
-->
|
|
</Label>
|
|
</Border>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
<Label Content="GPI2" HorizontalAlignment="Left" Margin="0 0 6 0"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPI2}"></Label>
|
|
</Border>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
|
<Label Content="GPI3" HorizontalAlignment="Left" Margin="0 0 6 0"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPI3}"></Label>
|
|
</Border>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="3" Orientation="Horizontal">
|
|
<Label Content="GPI4" HorizontalAlignment="Left" Margin="0 0 6 0"/>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Label Content="{Binding GPI4}"></Label>
|
|
</Border>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
<Border BorderBrush="Black" BorderThickness="0.5">
|
|
<Grid Margin="0 0 0 2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Label Grid.Row="0" Content="版本信息" HorizontalAlignment="Center" FontSize="14" FontWeight="Bold" FontStyle="Oblique"/>
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Column="0" Content="模块型号:" HorizontalAlignment="Left" FontSize="13" FontWeight="Bold"/>
|
|
<Label Grid.Column="1" Content="{Binding moduleInfo}" VerticalContentAlignment="Center"></Label>
|
|
<Label Grid.Column="2" Content="主板固件号:" HorizontalAlignment="Left" FontSize="13" FontWeight="Bold"/>
|
|
<Label Grid.Column="3" Content="{Binding motherboardFirmware}" VerticalContentAlignment="Center"></Label>
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
</Border>
|
|
</Window>
|