Exemplo n.º 1
0
        // Initialize ViewModel, navigation and commands
        public BusinesscardsViewModel(INavigation navigation)
        {
            Navigation    = navigation;
            cameraService = new CameraService();
            restService   = new RestService();
            imageService  = new ImageTransformationService();
            user          = User.InstanceUser;

            // If you want to change which OCR Service you want to use: this is the only place you need to change something (except for Tesseract -> network code is different)
            ocrService = new AzureFormRecognizer();
            //ocrService = new AzureVisionOCR();
            //ocrService = new TesseractOCR();

            LoadBusinessCards       = new Command(async() => await onLoadBusinessCards());
            AddBusinessCardManually = new Command(async() => await onAddManually());
            AddBusinessCardGallery  = new Command(async() => await onAddGallery());
            AddBusinessCardCamera   = new Command(async() => await onAddCamera());
        }
        // Initialize ViewModel, navigation and commands
        public BusinesscardEntryViewModel(INavigation navigation)
        {
            Navigation   = navigation;
            restService  = new RestService();
            imageService = new ImageTransformationService();
            mailService  = new MailService();

            _company = new ValidatableObject <string>();
            _name    = new ValidatableObject <string>();
            _email   = new ValidatableObject <string>();
            _phone   = new ValidatableObject <string>();
            _mobile  = new ValidatableObject <string>();
            _fax     = new ValidatableObject <string>();

            Card = new Businesscard();

            SaveBusinessCard   = new Command(async() => await OnSave());
            DeleteBusinessCard = new Command(async() => await OnDelete());

            AddValidations();
        }