diff --git a/Labaratory/Labaratory/Labaratory.csproj b/Labaratory/Labaratory/Labaratory.csproj
index 2eb5c33..f7695c4 100644
--- a/Labaratory/Labaratory/Labaratory.csproj
+++ b/Labaratory/Labaratory/Labaratory.csproj
@@ -150,6 +150,9 @@
Model1.tt
+
+ SessionWindow.xaml
+
MSBuild:Compile
Designer
@@ -158,10 +161,15 @@
App.xaml
Code
+
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
diff --git a/Labaratory/Labaratory/ViewModels/LoginViewModel.cs b/Labaratory/Labaratory/ViewModels/LoginViewModel.cs
index af6399e..5b52fcc 100644
--- a/Labaratory/Labaratory/ViewModels/LoginViewModel.cs
+++ b/Labaratory/Labaratory/ViewModels/LoginViewModel.cs
@@ -7,6 +7,8 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Wpf.Ui.Input;
+using Labaratory.ViewModels;
+using Labaratory.Views;
namespace Labaratory
{
@@ -16,19 +18,29 @@ namespace Labaratory
private string _password;
private string _captchaText;
private string _captchaInput;
- private bool _isCaptchaVisible;
+ private bool _isCaptchaValid;
private bool _isLoginEnabled = true;
private int _failedAttempts = 0;
private Models.LaboratoryDBEntities db = new Models.LaboratoryDBEntities();
-
+ private Visibility _CapchaVisibility = Visibility.Hidden;
// Свойства для привязки (Binding)
public string Login { get => _login; set { _login = value; OnPropertyChanged(); } }
- public string Password { get => _password; set { _password = value; OnPropertyChanged(); } }
+ public string Password
+ {
+ get => _password;
+ set
+ {
+ if (_password == value) return; // Обязательно!
+ _password = value;
+ OnPropertyChanged();
+ }
+ }
public string CaptchaText { get => _captchaText; set { _captchaText = value; OnPropertyChanged(); } }
public string CaptchaInput { get => _captchaInput; set { _captchaInput = value; OnPropertyChanged(); } }
- public bool IsCaptchaVisible { get => _isCaptchaVisible; set { _isCaptchaVisible = value; OnPropertyChanged(); } }
+ public bool IsCaptchaValid { get => _isCaptchaValid; set { _isCaptchaValid = value; OnPropertyChanged(); } }
public bool IsLoginEnabled { get => _isLoginEnabled; set { _isLoginEnabled = value; OnPropertyChanged(); } }
+ public Visibility CapchaVisibility { get => _CapchaVisibility; set { _CapchaVisibility = value; OnPropertyChanged(); } }
// Команды
public ICommand LoginCommand { get; }
@@ -36,7 +48,9 @@ namespace Labaratory
public LoginViewModel()
{
- LoginCommand = new RelayCommand