You must use TaskCompletionSource to convert EAP (event asynchronous model) to TAP (task asynchronous model). First, add new method to your ServiceAgent (you can create this even as an extension method):
public Task<string> GetLanguageAsync(EventHandler<languageCompletedEventArgs> callback)
{
var tcs = new TaskCompletionSource<string>();
EventHandler<languageCompletedEventArgs> callback;
callback = (sender, e) =>
{
_Proxy.languageCompleted -= callback;
tcs.TrySetResult(e.Result);
};
_Proxy.languageCompleted += callback;
_Proxy.languageAsync();
return tcs.Task;
}
TCS will create a task which you can await then. By using the existing model, it will bridge the gap and make it consumable with async/await. You can now consume it in the view model:
private void GetLanguage()
{
Language = await ServiceAgent.GetLanguageAsync();
}