diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index ebbf5af5..65642570 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -101,6 +101,8 @@ + + @@ -219,6 +221,8 @@ + + PreserveNewest diff --git a/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面.png b/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面.png new file mode 100644 index 00000000..b731d72f Binary files /dev/null and b/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面.png differ diff --git a/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面边框.png b/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面边框.png new file mode 100644 index 00000000..7fc4d56f Binary files /dev/null and b/BPASmartClient.CustomResource/Image/智慧城市科技风登录页面边框.png differ diff --git a/BPASmartClient.CustomResource/Pages/View/LoginView.xaml b/BPASmartClient.CustomResource/Pages/View/LoginView.xaml index 9d649bd0..d4cf34ce 100644 --- a/BPASmartClient.CustomResource/Pages/View/LoginView.xaml +++ b/BPASmartClient.CustomResource/Pages/View/LoginView.xaml @@ -12,7 +12,7 @@ Height="1080" AllowsTransparency="True" Background="{x:Null}" - Topmost="True" + Topmost="False" WindowStartupLocation="CenterScreen" WindowStyle="None" mc:Ignorable="d"> @@ -154,7 +154,7 @@ Margin="10,0" HorizontalAlignment="Left" VerticalAlignment="Center" - FontSize="20" + FontSize="{TemplateBinding FontSize}" Foreground="#88009dff" Text="请输入账号名称" Visibility="Collapsed" /> @@ -282,9 +282,11 @@ Grid.Row="1" Margin="20,20" BorderBrush="#009DFF" + Name="Username" BorderThickness="3" FontSize="30" Foreground="#009DFF" + KeyDown="TextBox_KeyDown" Style="{DynamicResource UserTextBoxStyle}" TabIndex="1" Text="{Binding UserName}" /> @@ -292,6 +294,7 @@ { this.DialogResult = true; this.Close(); }), "LoginOk"); - ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "ExitAction"); + ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "LoginOk", true); + ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "ExitAction", true); } private void LoginView_Loaded(object sender, RoutedEventArgs e) { - string path = @"Videos\Login.mp4"; + string path = $"{AppDomain.CurrentDomain.BaseDirectory}Videos\\Login.mp4"; if (File.Exists(path)) { - // 绑定视频文件 - player.Source = new Uri(path); - - // 交互式控制 - player.LoadedBehavior = MediaState.Manual; - - // 添加元素加载完成事件 -- 自动开始播放 - player.Loaded += new RoutedEventHandler(media_Loaded); - - // 添加媒体播放结束事件 -- 重新播放 - player.MediaEnded += new RoutedEventHandler(media_MediaEnded); - - // 添加元素卸载完成事件 -- 停止播放 - player.Unloaded += new RoutedEventHandler(media_Unloaded); - - player.MediaOpened += Player_MediaOpened; + player.Source = new Uri(path); // 绑定视频文件 + this.WindowState = WindowState.Maximized; + player.LoadedBehavior = MediaState.Manual; // 交互式控制 + player.Loaded += new RoutedEventHandler(media_Loaded); // 添加元素加载完成事件 -- 自动开始播放 + player.MediaEnded += new RoutedEventHandler(media_MediaEnded); // 添加媒体播放结束事件 -- 重新播放 + player.Unloaded += new RoutedEventHandler(media_Unloaded);// 添加元素卸载完成事件 -- 停止播放 + player.MediaOpened += Player_MediaOpened;//已播放事件 } } @@ -84,14 +74,17 @@ namespace BPASmartClient.CustomResource.Pages.View private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) { - if (this.pb.Password.Length > 0) - { - this.markText.Visibility = Visibility.Collapsed; - } - else - { - this.markText.Visibility = Visibility.Visible; - } + this.markText.Visibility = this.pb.Password.Length > 0 ? Visibility.Collapsed : Visibility.Visible; + } + + private void TextBox_KeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Enter) pb.Focus(); + } + + private void pb_KeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Enter) ActionManage.GetInstance.Send("EnterLogin"); } } } diff --git a/BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml b/BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml new file mode 100644 index 00000000..99537e94 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +