예제 #1
0
 //async void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 async public void SelectionChanged()
 {
     if (SelectedCard.Extra == "UNSCANNEDCARD")
     {
         Debug.WriteLine("The selected card is an unscanned card, which is stored locally");
         // Now the user has selected a card, which hasn't been scanned yet, so we save the base64 image locally and pass it on to the ocrservice
         string path = imageService.GetImagePath(SelectedCard.Base64);
         await SendToOCR(path, SelectedCard.Id);
     }
 }
        // Initialize ViewModel, navigation and commands using an existing businesscard
        public BusinesscardEntryViewModel(INavigation navigation, Businesscard card)
        {
            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      = card;
            _filename = imageService.GetImagePath(Card.Base64);

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

            AddValidations();
        }