Skip to content

Instantly share code, notes, and snippets.

@15mgm15
Last active December 4, 2017 06:07
Show Gist options
  • Save 15mgm15/675f42877c4e1dbde792fec37576fdc6 to your computer and use it in GitHub Desktop.
Save 15mgm15/675f42877c4e1dbde792fec37576fdc6 to your computer and use it in GitHub Desktop.
public class UnitTestViewModel
{
public Command LoadDataCommand { get; set; }
public string Data { get; set; }
readonly IDependencyService _dependencyService;
public UnitTestViewModel() : this(new DependencyServiceWrapper())
{
}
public UnitTestViewModel(IDependencyService dependencyService)
{
_dependencyService = dependencyService;
LoadDataCommand = new Command(async () => await LoadData());
}
public async Task LoadData()
{
Data = await _dependencyService.Get<IDeliverServerSideData>().GetJsonData();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment