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

How to properly read and write a file using Windows.Storage on Windows Phone 8

Here’s a simple example: public async Task WriteDataToFileAsync(string fileName, string content) { byte[] data = Encoding.Unicode.GetBytes(content); var folder = ApplicationData.Current.LocalFolder; var file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting); using (var s = await file.OpenStreamForWriteAsync()) { await s.WriteAsync(data, 0, data.Length); } } public async Task<string> ReadFileContentsAsync(string fileName) { var folder = ApplicationData.Current.LocalFolder; try { var file = await … Read more

Phonegap + Windows Phone 8 : viewport meta & scaling issue

Include this in Index.html, <meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0″ /> Include this in CSS: @viewport { width:320px; } @-ms-viewport { width:320px; zoom-user:fixed; max-zoom:1; min-zoom:1; } and include also this, body, html { -ms-overflow-style: none !important; } This will solve the issue for now, it worked for me in the same situation..!! 🙂

Memory consumption of BitmapImage/Image control in Windows Phone 8

I was dealing with the same problem and I think, in the end, that actually I’ve found a workaround, I am not a pro programmer but here is my solution: public Task ReleaseSingleImageMemoryTask(MyImage myImage, object control) { Pivot myPivot = control as Pivot; Task t = Task.Factory.StartNew(() => { Deployment.Current.Dispatcher.BeginInvoke(() => { if (myImage.img.UriSource != … Read more

How to use credentials in HttpClient in c#?

I had the exact same problem myself. It seems the HttpClient just disregards the credentials set in the HttpClientHandler. The following shall work however: using System.Net.Http.Headers; // For AuthenticationHeaderValue const string uri = “https://example.com/path?params=1”; using (var client = new HttpClient()) { var byteArray = Encoding.ASCII.GetBytes(“MyUSER:MyPASS”); var header = new AuthenticationHeaderValue( “Basic”, Convert.ToBase64String(byteArray)); client.DefaultRequestHeaders.Authorization = header; … Read more