1、文件架构
2、CommandBase.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace CourseManagement.Common
{
public class CommandBase : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return DoCanExecute?.Invoke(parameter)==true;
}
public void Execute(object parameter)
{
DoExecute?.Invoke(parameter);
}
public Action<object> DoExecute { get; set; }
public Func<object,bool> DoCanExecute { get; set; }
}
}
3、NotifyBase.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace CourseManagement.Common
{
public class NotifyBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void DoNotify([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this,new PropertyChangedEventArgs(propertyName));
}
}
}
4、PasswordHelper.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace CourseManagement.Common
{
public class PasswordHelper
{
public static readonly DependencyProperty PasswordProperty=
DependencyProperty.RegisterAttached("Password",typeof(string),typeof(PasswordHelper),
new PropertyMetadata("",new PropertyChangedCallback(OnPropertyChanged)));
public static string GetPassword(DependencyObject d)
{
return (string)d.GetValue(PasswordProperty);
}
public static void SetPassword(DependencyObject d, string value)
{
d.SetValue(PasswordProperty,value);
}
public static readonly DependencyProperty AttachProperty =
DependencyProperty.RegisterAttached("Attach", typeof(bool), typeof(PasswordHelper),
new PropertyMetadata(default(bool), new PropertyChangedCallback(OnAttached)));
public static bool GetAttach(DependencyObject d)
{
return (bool)d.GetValue(AttachProperty);
}
public static void SetAttach(DependencyObject d, string value)
{
d.SetValue(AttachProperty, value);
}
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
PasswordBox passwordBox=d as PasswordBox;
passwordBox.PasswordChanged -= Password_PasswordChanged;
if (!_isUpdating)
{
passwordBox.Password = e.NewValue?.ToString();
}
passwordBox.PasswordChanged += Password_PasswordChanged;
}
private static void OnAttached(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
PasswordBox passwordBox = d as PasswordBox;
passwordBox.PasswordChanged += Password_PasswordChanged;
}
private static bool _isUpdating = false;
private static void Password_PasswordChanged(object sender, RoutedEventArgs e)
{
PasswordBox passwordBox = sender as PasswordBox;
_isUpdating = true;
SetPassword(passwordBox, passwordBox.Password);
_isUpdating=false;
}
}
}
5、LoginModel.cs
using CourseManagement.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CourseManagement.Model
{
public class LoginModel:NotifyBase
{
private string _userName;
public string UserName
{
get { return _userName; }
set { _userName = value; this.DoNotify();}
}
private string _password;
public string Password
{
get { return _password; }
set { _password = value; this.DoNotify();}
}
private string _validationCode;
public string ValidationCode
{
get { return _validationCode; }
set { _validationCode = value; this.DoNotify();}
}
}
}
6、LoginView.xaml
<Window x:Class="CourseManagement.View.LoginView"
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:local="clr-namespace:CourseManagement.View"
xmlns:common="clr-namespace:CourseManagement.Common"
mc:Ignorable="d"
Title="系统登录" Height="600" Width="360"
FontFamily="Microsoft YaHei" FontWeight="ExtraLight"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
WindowStyle="None" AllowsTransparency="True" Background="{x:Null}"
Name="LoginWindow"
>
<Window.Resources>
<ControlTemplate TargetType="Button" x:Key="CLoseButtonTemplate">
<Border Background="Transparent" Name="Back">
<Path Data="M0,0 12,12 M0,12 12,0" Stroke="White" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Back" Property="Background" Value="#22FFFF"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Back" Property="Background" Value="#FF22FF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate TargetType="Button" x:Key="LoginButtonTemplate">
<Border Background="#007DFA" CornerRadius="5">
<Grid>
<Border CornerRadius="4" Background="#22ffffff" Name="Back" Visibility="Hidden"/>
<ContentControl Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="{TemplateBinding Foreground}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Visibility" Value="Visible" TargetName="Back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
<Style x:Key="UserNameTextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<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="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True"
CornerRadius="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="" FontFamily="../Assets/Fonts/#iconfont" FontSize="20"
VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#DDD"/>
<ScrollViewer x:Name="PART_ContentHost" Grid.Column="1" Focusable="false" HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
VerticalAlignment="Center" MinHeight="20"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
</Trigger>
</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>
<SolidColorBrush x:Key="TextBox.Static.Border1" Color="#FFABAdB3"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border1" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="TextBox.Focus.Border1" Color="#FF569DE5"/>
<Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}">
<Setter Property="PasswordChar" Value="●"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border1}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<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="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type PasswordBox}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True"
CornerRadius="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="" FontFamily="../Assets/Fonts/#iconfont" FontSize="20"
VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#DDD"/>
<ScrollViewer x:Name="PART_ContentHost" Grid.Column="1" Focusable="false" HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
VerticalAlignment="Center" MinHeight="20"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border1}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border1}"/>
</Trigger>
</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>
<SolidColorBrush x:Key="TextBox.Static.Border2" Color="#FFABAdB3"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border2" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="TextBox.Focus.Border2" Color="#FF569DE5"/>
<Style x:Key="ValidationCodeTextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border2}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<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="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True"
CornerRadius="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="" FontFamily="../Assets/Fonts/#iconfont" FontSize="20"
VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#DDD"/>
<ScrollViewer x:Name="PART_ContentHost" Grid.Column="1" Focusable="false" HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
VerticalAlignment="Center" MinHeight="20"/>
<Image Grid.Column="2" Source="../Assets/Validation/V0480.png" VerticalAlignment="Center" HorizontalAlignment="Center"
Opacity="0.5"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border2}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border2}"/>
</Trigger>
</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>
</Window.Resources>
<Border Margin="5" Background="White" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<!--第1行Log-->
<Border Background="#007DFA" CornerRadius="10 10 0 0" MouseLeftButtonDown="WinMove_MouseLeftButtonDown"/>
<Button VerticalAlignment="Top" HorizontalAlignment="Right" Width="30" Height="30"
Template="{StaticResource CLoseButtonTemplate}"
Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=LoginWindow}"/>
<StackPanel VerticalAlignment="Bottom" Margin="0 0 0 20">
<Border Width="100" Height="100" Background="White" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="5">
<Border.Effect>
<DropShadowEffect Color="white" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"/>
</Border.Effect>
<Border Width="80" Height="80">
<Border.Background>
<ImageBrush ImageSource="../Assets/Images/Logo.png"/>
</Border.Background>
</Border>
</Border>
<TextBlock Text="大浪淘沙" HorizontalAlignment="Center" FontSize="20" Foreground="White"/>
</StackPanel>
<!--第2行登录-->
<Grid Grid.Row="1" Margin="20 20">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition MinHeight="23" Height="auto"/>
</Grid.RowDefinitions>
<TextBox Text="{Binding LoginModel.UserName}" Style="{DynamicResource UserNameTextBoxStyle}" FontSize="16" Foreground="#555" Height="40"/>
<PasswordBox Style="{DynamicResource PasswordBoxStyle}" Grid.Row="1" FontSize="16" Foreground="#555" Height="40"
common:PasswordHelper.Attach="True" common:PasswordHelper.Password="{Binding LoginModel.Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Text="{Binding LoginModel.ValidationCode}" Style="{DynamicResource ValidationCodeTextBoxStyle}" Grid.Row="2" Height="40"/>
<Button Template="{StaticResource LoginButtonTemplate}" Content="登录" Grid.Row="3" Height="40" Foreground="White"
FontSize="16" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=LoginWindow}"/>
<TextBlock Text="{Binding ErrorMessage}" Grid.Row="4" Foreground="Red" FontSize="16" TextWrapping="Wrap" LineHeight="22"/>
</Grid>
<!--第3行其它方式-->
<Grid Grid.Row="2" Margin="20 0">
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="30"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderBrush="#DDD" BorderThickness="0 0 0 1" VerticalAlignment="Center"/>
<TextBlock Text="OR" Grid.Column="1" Foreground="#DDD" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Border Grid.Column="2" BorderBrush="#DDD" BorderThickness="0 0 0 1" VerticalAlignment="Center"/>
</Grid>
<UniformGrid Columns="3" Grid.Row="1">
<UniformGrid.Resources>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="#DDD"/>
<Setter Property="FontFamily" Value="../Assets/Fonts/#iconfont"/>
<Setter Property="FontSize" Value="40"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="#007DFA"/>
</Trigger>
</Style.Triggers>
</Style>
</UniformGrid.Resources>
<TextBlock Text=""/>
<TextBlock Text=""/>
<TextBlock Text=""/>
</UniformGrid>
</Grid>
</Grid>
</Border>
</Window>
7、LoginView.xaml.cs
using CourseManagement.Model;
using CourseManagement.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace CourseManagement.View
{
/// <summary>
/// LoginView.xaml 的交互逻辑
/// </summary>
public partial class LoginView : Window
{
public LoginView()
{
InitializeComponent();
this.DataContext = new LoginViewModel();
}
private void WinMove_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if(e.LeftButton == MouseButtonState.Pressed)
{
this.DragMove();
}
}
}
}
8、MainView.xaml
<Window x:Class="CourseManagement.View.MainView"
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:local="clr-namespace:CourseManagement"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
9、MainView.xaml.cs
namespace CourseManagement.View
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainView : Window
{
public MainView()
{
InitializeComponent();
}
}
}
10、LoginViewModel.cs
using CourseManagement.Common;
using CourseManagement.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace CourseManagement.ViewModel
{
public class LoginViewModel:NotifyBase
{
public LoginModel LoginModel { get; set; }=new LoginModel();
public CommandBase CloseWindowCommand { get; set; }
public CommandBase LoginCommand { get; set; }
private string _errorMessage;
public string ErrorMessage
{
get { return _errorMessage; }
set { _errorMessage = value; this.DoNotify(); }
}
public LoginViewModel()
{
//this.LoginModel = new LoginModel();
//this.LoginModel.UserName = "Tiger";
//this.LoginModel.Password = "123456";
this.CloseWindowCommand = new CommandBase();
this.CloseWindowCommand.DoExecute = new Action<object>((o) =>
{
(o as Window).Close();
});
this.CloseWindowCommand.DoCanExecute=new Func<object, bool>((o) => { return true; });
this.LoginCommand=new CommandBase();
this.LoginCommand.DoExecute = new Action<object>(DoLogin);
this.LoginCommand.DoCanExecute = new Func<object, bool>((o) => { return true; });
}
private void DoLogin(object o)
{
this.ErrorMessage = "";
if (string.IsNullOrEmpty(LoginModel.UserName))
{
this.ErrorMessage = "请输入用户名!";
return;
}
if (string.IsNullOrEmpty(LoginModel.Password))
{
this.ErrorMessage = "请输入密码!";
return;
}
if (string.IsNullOrEmpty(LoginModel.ValidationCode))
{
this.ErrorMessage = "请输入验证码!";
return;
}
if (LoginModel.ValidationCode.ToLower() != "0480")
{
this.ErrorMessage = "验证码输入不正确!";
return;
}
Application.Current.Dispatcher.Invoke(new Action(() =>
{
(o as Window).DialogResult = true;
}));
}
}
}
11、App.xaml
<Application x:Class="CourseManagement.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CourseManagement"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
</Application.Resources>
</Application>
12、App.xaml.cs
using CourseManagement.View;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace CourseManagement
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if(new LoginView().ShowDialog() == true)
{
new MainView().ShowDialog();
}
Application.Current.Shutdown();
}
}
}