How can I use async/await to call a webservice?

Assuming that loginAsync returns void, and loginCmpleted event fires when login is done, this is called the Event-based Asynchronous Pattern, or EAP. To convert EAP to await/async, consult Tasks and the Event-based Asynchronous Pattern. In particular, you’ll want to make use of the TaskCompletionSource to convert the event-based model to a Task-based model. Once you’ve … Read more

Properly handling HttpClient exceptions within async / await

As you are using HttpClient, try to use response.EnsureSuccessStatusCode(); Now HttpClient will throw exception when response status is not a success code. try { HttpResponseMessage response = await client.GetAsync(“http://www.ajshdgasjhdgajdhgasjhdgasjdhgasjdhgas.tk/”); response.EnsureSuccessStatusCode(); // Throw if not a success code. // … } catch (HttpRequestException e) { // Handle exception. } ORIGINAL SOURCE OF THE CODE: http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client

LongListSelector: Item tap?

You could null your LongListSelector’s SelectedItem at the end of each SelectionChanged event. I.e. <phone:LongListSelector x:Name=”LLS” SelectionChanged=”LLS_SelectionChanged”> And the event handler: private void LLS_SelectionChanged(object sender, SelectionChangedEventArgs e) { // If selected item is null, do nothing if (LLS.SelectedItem == null) return; // Navigate to the next page NavigationService.Navigate(new Uri(“/nextpage.xaml”, UriKind.Relative)); // Reset selected item to … Read more

Windows Phone 8.1 – Page Navigation

In Windows Phone 8.1, Page Navigation method is like this: Frame.Navigate(typeof(SecondPage), param); It means that you will navagate to ‘SecondPage’, and pass ‘param’ (a class based on object). If you needn’t to pass any parameters, You can use this: Frame.Navigate(typeof(SecondPage)); You can find the documentation for this MSDN link

Visual Studio 2013 stopped showing variable values when debugging

I had the same problem here (also using windows 8.1 and VS 2013) To fix it you need to open in VS Tools | Options | Debugger | General and enable the flag [Use Managed Compatibility Mode], which essentially gives you the VS 2012 function evaluation behavior. Reference: http://weblog.west-wind.com/posts/2013/Nov/21/Visual-Studio-2013-Could-not-evaluate-Expression-Debugger-Abnormality

The name ‘InitializeComponent’ does not exist in the current context. Cannot get any help on net searches [duplicate]

There are two potential causes of this. The most common is the x:Class doesn’t match up with the MainPage.xaml namespace. Make sure that x:Class in MainPage.xaml has the correct namespace. The second most common cause of this problem is that the “Build Action” is not set to “Page” for MainPage.xaml!

Unable to create the virtual machine

The Windows Phone 8 emulator requires hardware Hyper-V support. In particular, it requires second-level address translation, hardware assisted virtualization, and hardware DEP support enabled and to not be ran in a hypervisor(no nesting). If you bought your machine within the past 4 years you should have no problem with these requirements. You can check out … Read more