107 lines
7.1 KiB
XML
107 lines
7.1 KiB
XML
<UserControl x:Class="InSituLaboratory.Views.Pages.RelayView"
|
|
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:converters="clr-namespace:InSituLaboratory.Base;assembly=InSituLaboratory.Base"
|
|
xmlns:local="clr-namespace:InSituLaboratory.Views.Pages"
|
|
mc:Ignorable="d"
|
|
FontFamily="{StaticResource DigitalDisplay}">
|
|
<UserControl.Resources>
|
|
<converters:NegateConverter x:Key="NegateConverter" />
|
|
<converters:RelayStateConvert x:Key="RelayStateConvert" />
|
|
<Style TargetType="GroupBox">
|
|
<Setter Property="Margin" Value="10,5" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="GroupBox">
|
|
<Grid>
|
|
<!-- 左上角 -->
|
|
<Polyline HorizontalAlignment="Left" VerticalAlignment="Top" Points="0 30, 0 10, 10 0, 30 0" Stroke="#9918AABD" StrokeThickness="1" />
|
|
<!-- 左上角点 -->
|
|
<Ellipse Width="4" Height="4" Margin="24,-2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="#9918AABD" />
|
|
<Ellipse Width="4" Height="4" Margin="-2,24,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="#9918AABD" />
|
|
<!-- 右上角 -->
|
|
<Path HorizontalAlignment="Right" VerticalAlignment="Top" Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0" Stroke="#5518AABD" />
|
|
<!-- 左下角 -->
|
|
<Polyline HorizontalAlignment="Left" VerticalAlignment="Bottom" Points="0,0 0,15 10,15" Stroke="#5518AABD" />
|
|
<!-- 右下角 -->
|
|
<Polyline HorizontalAlignment="Right" VerticalAlignment="Bottom" Points="10,0 0,10" Stroke="#5518AABD" />
|
|
<!-- 右下角图标 -->
|
|
<Polygon HorizontalAlignment="Right" VerticalAlignment="Bottom" Fill="#9918AABD" Points="0,7 7 7 7 0" />
|
|
|
|
<Border Margin="30,-0.5,78,0" VerticalAlignment="Top" BorderBrush="#5518AABD" BorderThickness="0,1,0,0" />
|
|
<Border Margin="0,10" HorizontalAlignment="Right" BorderBrush="#5518AABD" BorderThickness="0,0,1,0" />
|
|
<Border Margin="10,0" VerticalAlignment="Bottom" BorderBrush="#5518AABD" BorderThickness="0,1,0,0" />
|
|
<Border Margin="-0.5,15" HorizontalAlignment="Left" BorderBrush="#5518AABD" BorderThickness="0,0,1,0" />
|
|
|
|
<!-- 箭头 -->
|
|
<Path Margin="10,13" HorizontalAlignment="Left" VerticalAlignment="Top" Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" />
|
|
<Path Margin="16,13" HorizontalAlignment="Left" VerticalAlignment="Top" Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" />
|
|
<!-- 字体 -->
|
|
<TextBlock Margin="25,8" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="#18AABD" Text="{TemplateBinding Header}" FontSize="18"/>
|
|
<!-- 占位对象 -->
|
|
<ContentPresenter />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
<Setter Property="Height" Value="30"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border BorderBrush="#DDD" BorderThickness="0,0,0,1" Name="border" Background="White">
|
|
<Grid>
|
|
<TextBlock VerticalAlignment="Center" Foreground="#DDD" Name="markText" Visibility="Collapsed" FontSize="12" Margin="3,0"/>
|
|
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalAlignment="Center" MinHeight="20"/>
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="BorderBrush" Value="#0b3d90" TargetName="border"/>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
|
<Setter Property="BorderBrush" Value="#0b3d90" TargetName="border"/>
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Path=Text,RelativeSource={RelativeSource Self}}" Value="">
|
|
<Setter TargetName="markText" Property="Visibility" Value="Visible"/>
|
|
</DataTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid Background="#FAFCFF" Margin="15">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="120"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid >
|
|
<GroupBox Header="通信连接" Margin="15">
|
|
<Grid Margin="0,30,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
|
|
<TextBlock Text="IP地址:" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="17"/>
|
|
<TextBox Width="150" VerticalAlignment="Center" FontSize="16" Margin="10,0" Text="{Binding SocketInfo.IP }"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
|
|
<TextBlock Text="端口号:" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="17"/>
|
|
<TextBox Width="150" VerticalAlignment="Center" FontSize="16" Text="{Binding SocketInfo.Port}" Margin="10,0" />
|
|
</StackPanel>
|
|
<Button Grid.Column="2" Content="{Binding SocketInfo.ConnectionMessage }" Style="{StaticResource NormalButtonStyle}" Width="150" Height="30" Command="{Binding ConnectionCommand}"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|