diff --git a/Plane.FormationCreator/ViewModels/ChangePasswordView.cs b/Plane.FormationCreator/ViewModels/ChangePasswordView.cs
new file mode 100644
index 0000000..9e1978f
--- /dev/null
+++ b/Plane.FormationCreator/ViewModels/ChangePasswordView.cs
@@ -0,0 +1,150 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Command;
+using Microsoft.Practices.ServiceLocation;
+using Plane.FormationCreator.Formation;
+using Plane.FormationCreator.Util;
+using Plane.FormationCreator.Views;
+using Plane.Util;
+using Plane.Windows.Messages;
+using System;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Interactivity;
+
+namespace Plane.FormationCreator.ViewModels
+{
+ ///
+ /// This class contains properties that a View can data bind to.
+ ///
+ /// See http://www.galasoft.ch/mvvm
+ ///
+ ///
+ public class ChangePasswordViewModel : ViewModelBase
+ {
+ private CopterManager _copterManager = ServiceLocator.Current.GetInstance();
+ private MainViewModel _MainViewModel=ServiceLocator.Current.GetInstance();
+ ///
+ /// Initializes a new instance of the LoginViewModel class.
+ ///
+ public ChangePasswordViewModel()
+ {
+
+ NewPassword = "";
+ OldPassword = "";
+ NewPassword1 = "";
+ Username = "";
+ }
+
+
+ private string _Username="";
+ public string Username
+ {
+ get { return _Username; }
+ set
+ {
+ Set(nameof(Username), ref _Username, value);
+ }
+ }
+
+
+
+
+ private string _OldPassword = "";
+ public string OldPassword
+ {
+ get { return _OldPassword; }
+ set
+ {
+ Set(nameof(OldPassword), ref _OldPassword, value);
+ }
+ }
+
+ private string _NewPassword = "";
+ public string NewPassword
+ {
+ get { return _NewPassword; }
+ set
+ {
+ Set(nameof(NewPassword), ref _NewPassword, value);
+ }
+ }
+ private string _NewPassword1 = "";
+ public string NewPassword1
+ {
+ get { return _NewPassword1; }
+ set
+ {
+ Set(nameof(NewPassword1), ref _NewPassword1, value);
+ }
+ }
+
+
+
+
+
+
+
+ private ICommand _ExitCommand;
+ public ICommand ExitCommand
+ {
+ get
+ {
+ return _ExitCommand ?? (_ExitCommand = new RelayCommand(wd =>
+ {
+ if (wd != null)
+ {
+ NewPassword = "";
+ OldPassword = "";
+ NewPassword1 = "";
+ Username = "";
+ wd.Close();
+ }
+
+ }));
+ }
+ }
+ private ICommand _ChangePasswordCommand;
+ public ICommand ChangePasswordCommand
+ {
+ get
+ {
+ return _ChangePasswordCommand ?? (_ChangePasswordCommand = new RelayCommand(wd =>
+ {
+ if (Username.Trim() == "")
+ {
+ Alert.Show("请输入账号!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ if (OldPassword=="")
+ {
+ Alert.Show("请输入原密码!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ if (NewPassword.Length<6)
+ {
+ Alert.Show("新密码长度不能低于6位!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ if (NewPassword != NewPassword1)
+ {
+ Alert.Show("两次新密码不相同!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+
+
+ _copterManager.NetChangePassword(Username.Trim(), OldPassword, NewPassword);
+
+ //wd.Close();
+
+ }));
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Plane.FormationCreator/ViewModels/LoginViewModel.cs b/Plane.FormationCreator/ViewModels/LoginViewModel.cs
new file mode 100644
index 0000000..ddffd1c
--- /dev/null
+++ b/Plane.FormationCreator/ViewModels/LoginViewModel.cs
@@ -0,0 +1,123 @@
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Command;
+using Microsoft.Practices.ServiceLocation;
+using Plane.FormationCreator.Formation;
+using Plane.FormationCreator.Util;
+using Plane.FormationCreator.Views;
+using Plane.Util;
+using Plane.Windows.Messages;
+using System;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Interactivity;
+
+namespace Plane.FormationCreator.ViewModels
+{
+ ///
+ /// This class contains properties that a View can data bind to.
+ ///
+ /// See http://www.galasoft.ch/mvvm
+ ///
+ ///
+ public class LoginViewModel : ViewModelBase
+ {
+ private CopterManager _copterManager = ServiceLocator.Current.GetInstance();
+ private MainViewModel _MainViewModel=ServiceLocator.Current.GetInstance();
+ ///
+ /// Initializes a new instance of the LoginViewModel class.
+ ///
+ public LoginViewModel()
+ {
+
+ Username = VersionControl.Username;
+ SavePassword = VersionControl.IssavePassword;
+ if (SavePassword)
+ Password = VersionControl.Password;
+ }
+
+
+ private string _Username="";
+ public string Username
+ {
+ get { return _Username; }
+ set
+ {
+ Set(nameof(Username), ref _Username, value);
+ }
+ }
+
+
+
+
+ private string _Password = "";
+ public string Password
+ {
+ get { return _Password; }
+ set
+ {
+ Set(nameof(Password), ref _Password, value);
+ }
+ }
+
+
+ private bool _SavePassword = false;
+ public bool SavePassword
+ {
+ get { return _SavePassword; }
+ set
+ {
+ Set(nameof(SavePassword), ref _SavePassword, value);
+ }
+ }
+
+
+
+
+
+
+ private ICommand _ExitCommand;
+ public ICommand ExitCommand
+ {
+ get
+ {
+ return _ExitCommand ?? (_ExitCommand = new RelayCommand(wd =>
+ {
+ if (wd != null)
+ {
+ wd.Close();
+ }
+
+ }));
+ }
+ }
+ private ICommand _LoginCommand;
+ public ICommand LoginCommand
+ {
+ get
+ {
+ return _LoginCommand ?? (_LoginCommand = new RelayCommand(wd =>
+ {
+ if (Username.Trim() == "")
+ {
+ Alert.Show("请输入账号!", "登录提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ if (Password == "")
+ {
+ Alert.Show("请输入密码!", "登录提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ _copterManager.NetLogoin(Username.Trim(), Password, SavePassword);
+ if (!SavePassword) Password = "";
+ wd.Close();
+
+ }));
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Plane.FormationCreator/Views/ChangePasswordView.xaml b/Plane.FormationCreator/Views/ChangePasswordView.xaml
new file mode 100644
index 0000000..a1d11e7
--- /dev/null
+++ b/Plane.FormationCreator/Views/ChangePasswordView.xaml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plane.FormationCreator/Views/ChangePasswordView.xaml.cs b/Plane.FormationCreator/Views/ChangePasswordView.xaml.cs
new file mode 100644
index 0000000..52d52dd
--- /dev/null
+++ b/Plane.FormationCreator/Views/ChangePasswordView.xaml.cs
@@ -0,0 +1,24 @@
+using Microsoft.Practices.ServiceLocation;
+using Plane.FormationCreator.ViewModels;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Plane.FormationCreator.Views
+{
+ ///
+ /// Description for ChangePasswordView.
+ ///
+ public partial class ChangePasswordView : Window
+ {
+ ///
+ /// Initializes a new instance of the ChangePasswordView class.
+ ///
+ public ChangePasswordView()
+ {
+ InitializeComponent();
+ ChangePasswordViewModel loginViewModel = ServiceLocator.Current.GetInstance();
+ this.DataContext = loginViewModel;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Plane.FormationCreator/Views/LoginView.xaml b/Plane.FormationCreator/Views/LoginView.xaml
new file mode 100644
index 0000000..3966c63
--- /dev/null
+++ b/Plane.FormationCreator/Views/LoginView.xaml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plane.FormationCreator/Views/LoginView.xaml.cs b/Plane.FormationCreator/Views/LoginView.xaml.cs
new file mode 100644
index 0000000..4b2e2fc
--- /dev/null
+++ b/Plane.FormationCreator/Views/LoginView.xaml.cs
@@ -0,0 +1,24 @@
+using Microsoft.Practices.ServiceLocation;
+using Plane.FormationCreator.ViewModels;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Plane.FormationCreator.Views
+{
+ ///
+ /// Description for LoginView.
+ ///
+ public partial class LoginView : Window
+ {
+ ///
+ /// Initializes a new instance of the LoginView class.
+ ///
+ public LoginView()
+ {
+ InitializeComponent();
+ LoginViewModel loginViewModel = ServiceLocator.Current.GetInstance();
+ this.DataContext = loginViewModel;
+ }
+ }
+
+}
\ No newline at end of file