277 lines
18 KiB
XML
277 lines
18 KiB
XML
<Window x:Class="StandardDesign.Views.LoginView"
|
|
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:StandardDesign.Views"
|
|
xmlns:c="clr-namespace:StandardDesign.Common;assembly=StandardDesign.Common"
|
|
DataContext="{Binding Source={StaticResource locator},Path=LoginViewModel}"
|
|
mc:Ignorable="d" Name="win" FontFamily="{StaticResource DigitalDisplay}"
|
|
ResizeMode="NoResize" Background="#f1f5fd" WindowStartupLocation="CenterScreen"
|
|
Title="系统登录" Height="540" Width="900">
|
|
|
|
<!--Win7下的效果不一样-->
|
|
<WindowChrome.WindowChrome>
|
|
<WindowChrome GlassFrameThickness="1"/>
|
|
</WindowChrome.WindowChrome>
|
|
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/StandardDesign.Assets;component/Styles/ButtonStyles.xaml"/>
|
|
|
|
<ResourceDictionary>
|
|
<!--IP地址样式-->
|
|
<Style x:Key="IPTextBoxStyle" TargetType="TextBox" >
|
|
<Setter Property="FontSize" Value="20"/>
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border BorderBrush="#DDD" BorderThickness="0,0,0,1" Height="40" SnapsToDevicePixels="True" Name="border">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="" FontFamily="{DynamicResource Iconfont}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40">
|
|
<TextBlock.Foreground>
|
|
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
|
|
<GradientStop Color="#16a1ff" Offset="0"/>
|
|
<GradientStop Color="#b4fee7" Offset="0.65"/>
|
|
<GradientStop Color="#16a1ff" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</TextBlock.Foreground>
|
|
</TextBlock>
|
|
<TextBlock Text="请输入IP" Grid.Column="1" VerticalAlignment="Center" Foreground="#DDD" Name="markText" Visibility="Collapsed"/>
|
|
<ScrollViewer Name="PART_ContentHost" Grid.Column="1"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Path=Text,RelativeSource={RelativeSource Mode=Self}}" Value="">
|
|
<Setter Property="Visibility" TargetName="markText" Value="Visible"/>
|
|
</DataTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!--Port样式-->
|
|
<Style x:Key="PortTextBoxStyle" TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="20"/>
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border BorderBrush="#DDD" BorderThickness="0,0,0,1" Height="40" SnapsToDevicePixels="True" Name="border">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="" FontFamily="{DynamicResource Iconfont}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40">
|
|
<TextBlock.Foreground>
|
|
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
|
|
<GradientStop Color="#16a1ff" Offset="0"/>
|
|
<GradientStop Color="#b4fee7" Offset="0.65"/>
|
|
<GradientStop Color="#16a1ff" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</TextBlock.Foreground>
|
|
</TextBlock>
|
|
<TextBlock Text="请输入端口号" Grid.Column="1" VerticalAlignment="Center" Foreground="#DDD" Name="markText" Visibility="Collapsed"/>
|
|
<ScrollViewer Name="PART_ContentHost" Grid.Column="1"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Path=Text,RelativeSource={RelativeSource Mode=Self}}" Value="">
|
|
<Setter Property="Visibility" TargetName="markText" Value="Visible"/>
|
|
</DataTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!--验证码样式-->
|
|
<Style x:Key="AuthorizeTextBoxStyle" TargetType="TextBox">
|
|
<Setter Property="FontSize" Value="20"/>
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border BorderBrush="#DDD" BorderThickness="0,0,0,1" Height="40" SnapsToDevicePixels="True" Name="border">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="" FontFamily="{DynamicResource Iconfont}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40">
|
|
<TextBlock.Foreground>
|
|
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
|
|
<GradientStop Color="#16a1ff" Offset="0"/>
|
|
<GradientStop Color="#b4fee7" Offset="0.65"/>
|
|
<GradientStop Color="#16a1ff" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</TextBlock.Foreground>
|
|
</TextBlock>
|
|
<TextBlock Text="请输入授权码" Grid.Column="1" VerticalAlignment="Center" Foreground="#DDD" Name="markText" Visibility="Collapsed"/>
|
|
<ScrollViewer Name="PART_ContentHost" Grid.Column="1"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
|
<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Path=Text,RelativeSource={RelativeSource Mode=Self}}" Value="">
|
|
<Setter Property="Visibility" TargetName="markText" Value="Visible"/>
|
|
</DataTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
</ResourceDictionary>
|
|
|
|
</Window.Resources>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!--左侧区域-->
|
|
<Grid Grid.Column="0" Background="#000A7B">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="70"/>
|
|
<RowDefinition Height="20"/>
|
|
<RowDefinition Height="120"/>
|
|
<RowDefinition Height="20"/>
|
|
<RowDefinition Height="70"/>
|
|
<RowDefinition Height="26"/>
|
|
<RowDefinition Height="26"/>
|
|
<RowDefinition Height="26" />
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<!--左上角Logo图标-->
|
|
<Border CornerRadius="10,0,0,10" BorderThickness="2" Width="100" Height="50" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10.0">
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="pack://application:,,,/StandardDesign.Assets;component/Images/Login/logo.png" />
|
|
</Border.Background>
|
|
</Border>
|
|
|
|
<!--右上角鸟图标-->
|
|
<Border CornerRadius="10" BorderThickness="2" Width="240" Height="50" VerticalAlignment="Top" HorizontalAlignment="Right" >
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="pack://application:,,,/StandardDesign.Assets;component/Images/Login/bird.png" />
|
|
</Border.Background>
|
|
</Border>
|
|
|
|
<!--正中间Logo图标-->
|
|
<Border Grid.Row="2" CornerRadius="10" BorderThickness="2" Width="100" Height="100" VerticalAlignment="Center" HorizontalAlignment="Stretch" >
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="pack://application:,,,/StandardDesign.Assets;component/Images/Login/Trademark.png" />
|
|
</Border.Background>
|
|
</Border>
|
|
|
|
<TextBlock Grid.Row="4" Text="岛礁观测系统" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="30"/>
|
|
<TextBlock Grid.Row="5" Text="集成水质、水文监测和水下成像技术" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White" FontSize="15"/>
|
|
<TextBlock Grid.Row="6" Text="实现对珊瑚礁附近海域温度、盐度、深度、叶绿素、" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="15"/>
|
|
<TextBlock Grid.Row="7" Text="CO2、流速等多参数要素及水下高清视频的长期在线观测" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="15"/>
|
|
<TextBlock Grid.Row="8" Text="2024 - ZTMS" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="20" />
|
|
|
|
<!--左下角船图标-->
|
|
<Border Grid.Row="9" CornerRadius="10" BorderThickness="2" Width="170" Height="70" VerticalAlignment="Bottom" HorizontalAlignment="Left" >
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="pack://application:,,,/StandardDesign.Assets;component/Images/Login/ship.png" />
|
|
</Border.Background>
|
|
</Border>
|
|
|
|
<!--右下角波浪线图标-->
|
|
<Border Grid.Row="9" CornerRadius="10" BorderThickness="2" Width="286" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Right" >
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="pack://application:,,,/StandardDesign.Assets;component/Images/Login/wave.png" />
|
|
</Border.Background>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!--右侧区域-->
|
|
<Grid Grid.Column="1" Background="#000A7B" >
|
|
<Border CornerRadius="60,0,0,60" Background="White">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40"/>
|
|
<RowDefinition Height="100"/>
|
|
<RowDefinition Height="70"/>
|
|
<RowDefinition Height="70"/>
|
|
<RowDefinition Height="70"/>
|
|
<RowDefinition />
|
|
<RowDefinition Height="80"/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<!--窗口控制按钮-->
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="20,10">
|
|
<Button Content="" FontFamily="{DynamicResource Iconfont}" FontSize="14" Click="Button_MinClick" Style="{StaticResource WindowControlButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" Margin="10,0"/>
|
|
<!--<Button Content="" FontFamily="{DynamicResource Iconfont}" FontSize="14" Click="Button_MaxClick" Style="{StaticResource WindowControlButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" Margin="10,0"/>-->
|
|
<Button Content="" FontFamily="{DynamicResource Iconfont}" FontSize="14" Click="Button_CloseClick" Style="{StaticResource WindowControlButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" />
|
|
</StackPanel>
|
|
|
|
<TextBlock Text="Socket连接" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30"/>
|
|
|
|
<!--Ip-->
|
|
<TextBox Grid.Row="2" VerticalContentAlignment="Center" Style="{StaticResource IPTextBoxStyle}"
|
|
Text="{Binding IP,UpdateSourceTrigger=PropertyChanged}" Width="287"/>
|
|
<!--端口号-->
|
|
<TextBox Grid.Row="3" VerticalContentAlignment="Center" Style="{StaticResource PortTextBoxStyle}"
|
|
Text="{Binding Port,UpdateSourceTrigger=PropertyChanged}" Width="287"/>
|
|
<!--授权码-->
|
|
<TextBox Grid.Row="4" VerticalContentAlignment="Center" Style="{StaticResource AuthorizeTextBoxStyle}"
|
|
Text="{Binding AuthorizeCode,UpdateSourceTrigger=PropertyChanged}" Width="287"/>
|
|
<!--错误提示信息-->
|
|
<TextBlock Text="{Binding FailedMsg}" Grid.Row="5" Foreground="Red" VerticalAlignment="Center"
|
|
HorizontalAlignment="Center" TextWrapping="Wrap"/>
|
|
|
|
<!--登录-->
|
|
<Button Content="登录" Grid.Row="6" Height="35" Style="{StaticResource NormalButtonStyle}"
|
|
Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=win}" Margin="82,22,83,23"/>
|
|
|
|
<!--记住当前设置-->
|
|
<CheckBox Content="记住当前设置" Foreground="#BBB" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center"
|
|
FontSize="15" Grid.Row="7" IsChecked="{Binding IsRecord}" Margin="51,0,0,0"/>
|
|
|
|
<!--跳过连接-->
|
|
<Button Content="跳过连接" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Foreground="#1E90FF" Command="{Binding SkipCommand}"
|
|
CommandParameter="{Binding ElementName=win}" Grid.Row="7" FontSize="15" HorizontalAlignment="Left" Margin="354,0,0,0"/>
|
|
|
|
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</Window>
|