Exemple #1
0
        private async void OnLogInMethod(object passwordBox)
        {
            try
            {
                Error           = "";
                IsBusy          = true;
                CurrentUserName = null;
                if ((CurrentUser = await notes.CheckUserCredentials(Login, ((PasswordBox)passwordBox).Password)) != null)
                {
                    CurrentUserName = CurrentUser.Login;
                    MenuVisibility  = Visibility.Visible;
                    WindowTitle     = $"Your Notes -- {CurrentUser.FirstName} {CurrentUser.LastName}";
                    SetCalendarViewMethod();
                    ((CalendarViewModel)CalendarView.DataContext).BuildCalendar(DateTime.Today);
                }
                else
                {
                    Error = "Invalid Login or Password";
                }

                IsBusy = false;
            }
            catch (Exception ex)
            {
                Error  = "Inexpected Error";
                IsBusy = false;
            }
        }