Exemplo n.º 1
0
        protected override void LoadData()
        {
            try {
                ErrorMsg = string.Empty;
                InfoMsg  = string.Empty;
                IscmdNewRegisterVisible = false;

                RoleList = new ObservableCollection <string>();
                var lip = _DataService.LoggedInUser as PersonDetails;

                if (lip == null)
                {
                    RoleList.Add("Diák");
                    IsCancelCommandVisible = true;
                }
                else
                {
                    RoleList.Add("Diák");
                    RoleList.Add("Tanár");
                    RoleList.Add("Admin");

                    IsCancelCommandVisible = false;
                }
                NewPersonInst = NewPerson.Create();
                RegisterCommand.RaiseCanExecuteChanged();
            }
            catch (SessionExpiredException) {
                MessengerInstance.Send <NavigationMessage>(new NavigationMessage {
                    View = ViewEnum.Login, UserState = "SessionExpired"
                });
            }
        }
        private async void PickPhotoCommandExecute()
        {
            try
            {
                var action = await DisplayPictureAlert();

                var pictureService = Xamarin.Forms.DependencyService.Get <PictureService>();
                var file           = await pictureService.GetPicture(action);

                if (file != null)
                {
                    using (var memoryStream = new MemoryStream())
                    {
                        file.GetStream().CopyTo(memoryStream);
                        file.Dispose();
                        Image = memoryStream.ToArray();

                        RegisterCommand.RaiseCanExecuteChanged();
                    }
                }
            }
            catch (Exception ex)
            {
                await _dialogService.DisplayAlertAsync("Erro", ex.Message, "Fechar");
            }
        }
 private void ExecuteRemove(User user)
 {
     //TODO: confirmation popup dialog
     db.Users.Remove(user);
     db.SaveChanges();
     FetchModels();
     RegisterCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 4
0
 private void _expense_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "IsValid":
         RegisterCommand.RaiseCanExecuteChanged();
         break;
     }
 }
 void Settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == GetMemberName(() => Settings.AdmiralID))
     {
         Settings.IsAuthorized = false;
         Settings.Password     = null;
         StopSending();
     }
     RegisterCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 6
0
 private void This_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     PreviousCommand.RaiseCanExecuteChanged();
     NextCommand.RaiseCanExecuteChanged();
     RegisterCommand.RaiseCanExecuteChanged();
 }