Last active
March 2, 2018 21:32
-
-
Save pictos/100667d7c4a9c9afe1af58c66a2763fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using App6.Interfaces; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace App6.ViewModels | |
{ | |
public class ScanViewModel : BaseViewModel | |
{ | |
public Command ScanCommand { get; } | |
public ScanViewModel() | |
{ | |
ScanCommand = new Command(async () => await ExecuteScanCommand()); | |
} | |
async Task ExecuteScanCommand() | |
{ | |
var scanner = DependencyService.Get<IScan>(); | |
var result = await scanner.ScanAsync(); | |
if (result != null) | |
await DisplayAlert("Resultado", result, "Ok"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment