|
- <Window
- x:Class="BPASmartClient.CustomResource.Pages.View.SubPagLoginView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:common="clr-namespace:BPASmartClient.CustomResource.Pages.Model"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
- Title="SubPagLoginView"
- Width="800"
- Height="450"
- AllowsTransparency="True"
- Background="{x:Null}"
- Topmost="True"
- WindowStartupLocation="CenterScreen"
- WindowStyle="None"
- mc:Ignorable="d">
-
- <Window.DataContext>
- <vm:LoginViewModel />
- </Window.DataContext>
-
- <Window.Resources>
- <Style x:Key="TxLogin" TargetType="TextBlock">
- <Setter Property="FontSize" Value="20" />
- <Setter Property="Foreground" Value="#ddd" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
-
- <!--#region 密码输入框样式-->
- <Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="FontFamily" Value="Times New Roman" />
- <Setter Property="PasswordChar" Value="●" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="Padding" Value="1" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="AllowDrop" Value="true" />
- <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
- <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
- <Setter Property="CaretBrush" Value="#009DFF" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type PasswordBox}">
- <Border
- x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5"
- SnapsToDevicePixels="true">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="UserTextBlock"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="../../Fonts/#iconfont"
- FontSize="{TemplateBinding FontSize}"
- Foreground="{TemplateBinding BorderBrush}"
- Text="" />
-
- <!--<TextBlock
- Name="markText"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#88009dff"
- Text="请输入账号密码"
- Visibility="Collapsed" />-->
-
- <ScrollViewer
- x:Name="PART_ContentHost"
- Grid.Column="1"
- MinHeight="{TemplateBinding FontSize}"
- VerticalAlignment="Center"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
-
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Bd" Property="Opacity" Value="0.56" />
- <Setter TargetName="UserTextBlock" Property="Opacity" Value="0.56" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Bd" Property="BorderBrush" Value="#FF7EB4EA" />
- <Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF7EB4EA" />
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter TargetName="Bd" Property="BorderBrush" Value="#FF569DE5" />
- <Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF569DE5" />
- </Trigger>
- <!--<DataTrigger Binding="{Binding Path=Password, RelativeSource={RelativeSource Mode=self}}" Value="">
- <Setter TargetName="markText" Property="Visibility" Value="Visible" />
- </DataTrigger>-->
-
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
- <Condition Property="IsSelectionActive" Value="false" />
- </MultiTrigger.Conditions>
- <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
- </MultiTrigger>
- </Style.Triggers>
- </Style>
- <!--#endregion-->
-
- <!--#region 用户输入框样式-->
- <Style x:Key="UserTextBoxStyle" TargetType="TextBox">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="CaretBrush" Value="#009DFF" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="TextBox">
- <Border
- x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5"
- SnapsToDevicePixels="true">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="PasswordTextBlock"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="../../Fonts/#iconfont"
- FontSize="{TemplateBinding FontSize}"
- Foreground="{TemplateBinding BorderBrush}"
- Text="" />
-
- <TextBlock
- Name="markText"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{TemplateBinding FontSize}"
- Foreground="#88009dff"
- Text="请输入账号名称"
- Visibility="Collapsed" />
-
-
- <ScrollViewer
- x:Name="PART_ContentHost"
- Grid.Column="1"
- MinHeight="20"
- VerticalAlignment="Center"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
-
- </Border>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="border" Property="Opacity" Value="0.56" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
- </Trigger>
- <DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource Mode=self}}" Value="">
- <Setter TargetName="markText" Property="Visibility" Value="Visible" />
- </DataTrigger>
- </ControlTemplate.Triggers>
-
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
-
- <!--#region 操作按钮样式-->
- <Style x:Key="ButtonStyle" TargetType="Button">
- <Setter Property="Margin" Value="5" />
- <Setter Property="Background" Value="#cc009DFF" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- Name="TitleBarBr"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5">
- <ContentPresenter
- Margin="{TemplateBinding Margin}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="TitleBarBr" Property="Background" Value="#009DFF" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
-
- </Window.Resources>
-
- <Grid>
- <Grid.Background>
- <ImageBrush ImageSource="../../Image/智慧城市科技风登录页面边框.png" />
- </Grid.Background>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1.05*" />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="0.9*" />
- <RowDefinition />
- <RowDefinition Height="1.2*" />
- </Grid.RowDefinitions>
-
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#FFEF2020"
- Text="{Binding ErrorInfo}" />
-
- <Grid
- x:Name="grid"
- Grid.Row="1"
- Grid.Column="1">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <TextBox
- Name="Username"
- Margin="5,5"
- BorderBrush="#009DFF"
- BorderThickness="3"
- FontSize="16"
- Foreground="#009DFF"
- KeyDown="TextBox_KeyDown"
- Style="{DynamicResource UserTextBoxStyle}"
- TabIndex="1"
- Text="{Binding UserName}" />
-
- <PasswordBox
- Name="pb"
- Grid.Row="1"
- Margin="5"
- common:PasswordHelper.Attach="True"
- common:PasswordHelper.Password="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- BorderBrush="#009DFF"
- BorderThickness="3"
- FontSize="16"
- Foreground="#009DFF"
- KeyDown="pb_KeyDown"
- PasswordChanged="PasswordBox_PasswordChanged"
- Style="{DynamicResource PasswordBoxStyle}"
- TabIndex="2" />
-
- <TextBlock
- Name="markText"
- Grid.Row="1"
- Margin="58,5"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="#88009dff"
- IsHitTestVisible="False"
- Text="请输入账号密码"
- Visibility="Visible" />
-
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Button
- Command="{Binding ExitCommand}"
- Content="退 出"
- Style="{StaticResource ButtonStyle}" />
-
- <Button
- Grid.Column="1"
- Command="{Binding LoginCommand}"
- Content="登 录"
- Style="{StaticResource ButtonStyle}"
- TabIndex="3" />
-
- </Grid>
-
- </Grid>
-
-
- </Grid>
-
-
- </Window>
|