public PresentContactPageViewModel(INavigationService navigationService, IPageDialogService dialogService, IPersonDB personDB) : base(navigationService, dialogService, personDB)
 {
     FavoriteImage     = Person.IsFavorite ? "ic_action_star.png" : "ic_action_star_border.png";
     EditPersonCommand = new DelegateCommand(async() => {
         var param = new NavigationParameters
         {
             { Person.GetType().Name, Person }
         };
         await navigationService.NavigateAsync(ConstPage.RegisterContactPage, param);
     });
     FavoritePersonCommand = new DelegateCommand(async() => {
         Person.IsFavorite = !Person.IsFavorite;
         FavoriteImage     = Person.IsFavorite ? "ic_action_star.png" : "ic_action_star_border.pngr";
         await personDB.SaveItemAsync(Person);
     });
 }
Exemple #2
0
 public PersonManager(IPersonDB personDb, IPrintTypeDB printTypeDb)
 {
     PersonDb    = personDb;
     PrintTypeDb = printTypeDb;
 }
 public BaseViewModel(INavigationService navigationService, IPageDialogService dialogService, IPersonDB personDB)
 {
     this.navigationService = navigationService;
     this.dialogService     = dialogService;
 }
Exemple #4
0
 public PersonManager(IPersonDB userDb)
 {
     UserDb = userDb;
 }
 public AuthenticationMiddleware(RequestDelegate next, IPersonDB personDB)
 {
     this._next    = next;
     this.personDB = personDB as PersonDB;
 }
 public ScannerContactPageViewModel(INavigationService navigationService, IPageDialogService dialogService, IPersonDB personDB, IDeviceService deviceService) : base(navigationService, dialogService, personDB)
 {
     IsScanning     = true;
     ScannerCommand = new DelegateCommand(() =>
     {
         var param = new NavigationParameters
         {
             { Person.GetType().Name, Person }
         };
         deviceService.BeginInvokeOnMainThread(async() =>
         {
             Person.NamePerson = Result.Text.IsSeparatorString()[0];
             Person.Lastname   = Result.Text.IsSeparatorString()[1];
             Person.Phone      = Result.Text.IsSeparatorString()[2];
             IsScanning        = false;
             await navigationService.NavigateAsync(ConstPage.RegisterContactPage, param);
         });
     });
 }
Exemple #7
0
        public RegisterContactPageViewModel(INavigationService navigationService, IPageDialogService dialogService, IPersonDB personDB) : base(navigationService, dialogService, personDB)
        {
            var rnd = new Random();

            IsVisibleCommand   = true;
            IsVisible          = false;
            Person.ImagePerson = Person.ImagePerson == null? "Captureusuario":Person.ImagePerson;
            MoreFieldsCommand  = new DelegateCommand(() =>
            {
                IsVisible        = !IsVisible;
                IsVisibleCommand = !IsVisibleCommand;
            });
            CultureInfo ci = new CultureInfo("es-MX");

            SaveCommand = new DelegateCommand(async() =>
            {
                Person.FrameColor = rnd.Next(1, 10);

                if (!string.IsNullOrEmpty(Person.NamePerson) || !string.IsNullOrEmpty(Person.NickName))
                {
                    Person.NamePerson  = ci.TextInfo.ToTitleCase(Person.NamePerson);
                    var name           = Person.NickName == null ? Person.NamePerson.FirtsLetter():Person.NickName.FirtsLetter();
                    Person.ImagePerson = Person.ImagePerson == "Captureusuario" ? name : Person.ImagePerson;
                    await personDB.SaveItemAsync(Person);
                    await navigationService.GoBackAsync();
                }
            });
            TakePhotoCommand = new DelegateCommand(async() => {
                var select = await dialogService.DisplayActionSheetAsync("chosess image", "Cancel", null, selectPicture, takepicture);
                switch (select)
                {
                case "Select picture":
                    {
                        LoadImage();
                        break;
                    }

                case "Take a picture":
                    {
                        TakeImage();
                        break;
                    }

                default:
                    break;
                }
            });
        }
 public MyGenealogieController(IPersonDB personDB)
 {
     this.personDB = personDB as PersonDB;
 }