Use local images in Webbrowser control

You will need to store your images in the Isolated Storage and then display the images from there. I have put together a sample that you can download from the following location :- www.smartmobiledevice.co.uk/projects/webbrowserimagesample.zip This is based on the MSDN article How to: Display Static Web Content Using the WebBrowser Control for Windows Phone.

Add custom header in HttpWebRequest

You use the Headers property with a string index: request.Headers[“X-My-Custom-Header”] = “the-value”; According to MSDN, this has been available since: Universal Windows Platform 4.5 .NET Framework 1.1 Portable Class Library Silverlight 2.0 Windows Phone Silverlight 7.0 Windows Phone 8.1 https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.headers(v=vs.110).aspx

Close a WP7 application programmatically? [duplicate]

You can always call an exit by doing this at your landing page use this code on click of your application back button: if (NavigationService.CanGoBack) { while (NavigationService.RemoveBackEntry() != null) { NavigationService.RemoveBackEntry(); } } This will remove back entries from the stack, and you will press a back button it will close the application without … Read more

Deserializing JSON using JSon.NET with dynamic data

The simplest method. In this particular case would probably be to go dynamic. dynamic data = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(json); var lastRevId = data.query.pages[“6695”].lastrevid; You can reference any element by it’s [] name so you can do something like data[“query”][“pages”][“6695”][“lastrevid”]. This will get by all those little objects where the name isn’t valid in c#.

Converting image to base64

What about trying: public static BitmapImage base64image(string base64string) { byte[] fileBytes = Convert.FromBase64String(base64string); using (MemoryStream ms = new MemoryStream(fileBytes)) { Image streamImage = Image.FromStream(ms); context.Response.ContentType = “image/jpeg”; streamImage.Save(context.Response.OutputStream, ImageFormat.Jpeg); return streamImage; } } I agree with Alexei that your code for reading the image in does look a little strange. I’ve recently written some code … Read more

Display GIF in a WP7 application with Silverlight

In fact, it’s working, but it lacks some documentation. After some troubles, here’s how to use it : reference ImageTools reference ImageTools.Controls reference ImageTools.IO.Gif Add namespace in xaml : xmlns:imagetools=”clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls” And resources : <phone:PhoneApplicationPage.Resources> <imagetools:ImageConverter x:Key=”ImageConverter” /> </phone:PhoneApplicationPage.Resources> Then use the control with the converter : <imagetools:AnimatedImage Source=”{Binding ImageSource, Converter={StaticResource ImageConverter}}” /> Your ImageSource should … Read more

How to access a specific item in a Listbox with DataTemplate?

Thank you for your help guys!! Finally i got it. Solved the problem with the VisualTreeHelper. What a great function ^^ private void ContactListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ContactListBox.SelectedIndex == -1) return; currentSelectedListBoxItem = this.ContactListBox.ItemContainerGenerator.ContainerFromIndex(ContactListBox.SelectedIndex) as ListBoxItem; if (currentSelectedListBoxItem == null) return; // Iterate whole listbox tree and search for this items TextBox nameBox … Read more