Pull to refresh On Windows Phone

Check out this: WP8PullToRefreshDetector.cs using Microsoft.Phone.Controls; using System; using System.Windows.Controls.Primitives; /// <summary> /// This class detects the pull gesture on a LongListSelector. How does it work? /// /// This class listens to the change of manipulation state of the LLS, to the MouseMove event /// (in WP, this event is triggered when the user moves … Read more

How to post data using HttpClient?

You need to use: await client.PostAsync(uri, content); Something like that: var comment = “hello world”; var questionId = 1; var formContent = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>(“comment”, comment), new KeyValuePair<string, string>(“questionId”, questionId) }); var myHttpClient = new HttpClient(); var response = await myHttpClient.PostAsync(uri.ToString(), formContent); And if you need to get the response after post, … Read more

Windows Phone 8.1 Universal App terminates on navigating back from second page?

This is new to Windows Phone 8.1. If you create a new Hub Universal App using a VS2013 template, you’ll notice a class in Common folder called a NavigationHelper. This NavigationHelper gives you a hint how to properly react to back button press. So, if you don’t want to use the NavigationHelper, here’s how to … Read more

How to pass values (parameters) between XAML pages?

Methods to pass parameters 1. Using the query string You can pass parameters through the query string, using this method means have to convert your data to strings and url encode them. You should only use this to pass simple data. Navigating page: page.NavigationService.Navigate(new Uri(“/Views/Page.xaml?parameter=test”, UriKind.Relative)); Destination page: string parameter = string.Empty; if (NavigationContext.QueryString.TryGetValue(“parameter”, out … Read more

tech