Visually Located

XAML and GIS

Why does my ListView scroll to the top when navigating backwards?

I’ve seen a few people asking this question. They have a page which contains a ListView and when an item is selected it navigates to another page. When they navigate backwards the ListView is back up to the top again. This behavior is due to the NavigationCacheMode of the page. By default the page will not cache rendered content when navigating “forward”. So when you navigate back to the page it re-renders the content. When displaying content like a ListView this will cause it to show the top content. As with most things, there are a few solutions to this problem. The most common solution is to set the NaivationCacheMode to Enabled or Required. public ListPage(){ this.InitializeComponent();  this.NavigationCacheMode = NavigationCacheMode.Required;} These options do the following: Member Value Description Disabled 0 The page is never cached and a new instance of the page is created on each visit. Required 1 The page is cached and the cached insta... [More]

Displaying HTML content in a TextBlock

So many apps are using third party services to display data. Some of these services may give detailed information in HTML format. Why would they give information in HTML? Simple it’s universal. Everyone can display HTML. All of the platforms have some form of a webview control to display HTML. I recently came across such a service that actually gave information in both plain text and HTML. The plain text did not offer the detail that the HTML content did. So I set out to create a way to display the HTML inside a TextBlock. You may ask why I did not use a Webview control and I’ll say with a smile “Because I didn’t want to”. I’ll be 100% honest here, I took some pointers from the HtmlAgilityPack. I should note that this is not intended to display an entire website. You can adjust it to work, but just don’t. To tackle this task I created a new Behavior that would adjust the text of a TextBlock when it was loaded. The Runtime Interactivity SDK does not include a base Behavior class like th... [More]

The power of responding to user reviews in the Windows Phone Store

I have been responding to user reviews since the day it went live for all publishers Sending my first app review response. Hopefully this goes well! #wpdev pic.twitter.com/IeXBHTrEqY— Shawn Kendrot (@skendrot) August 12, 2014 This was my first response to a user, and it worked! WooHoo! Review response worked! User contacted me #wpdev— Shawn Kendrot (@skendrot) August 13, 2014 Responding to user reviews has been positive for me. I wanted to share a few of the positive results with everyone.   Matt responded to my email saying the 1 star rating was an oversight and updated his review   There was a day when an app stopped getting information from services and some people reviewed the app poorly because it wasn’t working. These reviews were valid because the app stopped working. I was able to fix the issue and responded to users.   And like most developers I was effected by the In App Purchase bug the store had in September. Again users started posting poor reviews. Onc... [More]

Alternatives to OpacityMask

In Windows Phone Silverlight apps you had the ability to take a png image and change the color of the image with an OpacityMask. This is a really handy tool to have when you want to show different state to a user or use one image and have it work with different backgrounds. Where is an example: <StackPanel Orientation="Horizontal"> <Image Source="Assets/appbar.book.png" Width="72" Height="72"></Image> <Rectangle Fill="Red" Width="72" Height="72" > <Rectangle.OpacityMask> <ImageBrush ImageSource="Assets/appbar.book.png" Stretch="Fill"/> </Rectangle.OpacityMask> </Rectangle> <Border Background="{StaticResource PhoneForegroundBrush}" Width="72" Height="72" > <Rectangle Fill="{StaticResource PhoneBackgroundBrush}" > <Rectangle.OpacityMask> <Image... [More]

Give your lists the space they deserve

This blog serves as a public service announcement to give your ListBox, ListView, ItemsControl, whatever you choose the space that they deserve. I have seen a lot of apps (and often forget to do this myself!) that do not extend their lists all the way to the right of the page and keep the page too close to the bottom. It is easy to fall into this trap because of the defaults within Visual Studio. Take a look at the following examples: Notice that huge gap to the side? Now take a look at the settings apps Look mom! No gap! So what causes this gap? It’s the default template for pages in Visual Studio. When you create a new page for Windows Phone Silverlight apps you get the following <!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> </Grid> Notice the side margin of 12? This is a design guideline to leave the gap, but lists give you this b... [More]

Working with location in an ArcGIS Runtime map app

This is the forth blog in a series of posts reviewing the new ArcGIS Runtime (beta) mapping SDK. The new SDK will be a great companion for any Windows developer wanting to add map functionality to their apps. In part 3, we looked at the MapView control within the SDK. One of the dependency properties that I left off in that post is the LocationDisplay property. This post will go into that property extensively. Working with location is probably my favorite part of the new ArcGIS Runtime mapping SDK because it is just so damn simple. In most mapping SDKs (eg: Nokia, Bing) you must do the work of hooking up to location changes, and updating the map. In the ArcGIS Runtime mapping SDK, it’s handled for you if you opt in for this functionality. Start off by downloading the sample application (if you have not done so already). The LocationDisplay property of the MapView provides access to the LocationDisplay class. This class provides access to all the properties that make working with locat... [More]

Working with the MapView control in the ArcGIS Runtime

This is the third in a series of posts covering the new ArcGIS Runtime SDK. In part 2, I discussed the basic mapping layers within the ArcGIS Runtime. Now that we know how to add a map and layers to your app, let’s see what we can do with the map! As I mentioned in the first post, the new ArcGIS Runtime has a MapView, rather than a Map that you put in your app. The MapView has a Map property that must be set, but all of the functionality lies in the MapView. We’ll start out with some of the key dependency properties. We’ll then look at the map events, and finish with the few methods. Dependncy Properties The new MapView control has 11 dependency properties (with one additional attached dependency property). In this blog we’ll focus on seven of them. Not to worry about the other four. One we have already covered (Map), one will be covered in the next blog and two more when discussing GIS focused work. In this blog I’ll cover the following dependency properties. MapGrid Maximum... [More]

Working with Basic Mapping Layers in the ArcGIS Runtime Map

This is a second in a series of posts covering the new ArcGIS Runtime (beta). In the last post we walked through creating a simple map app. In this post we’ll start to cover the different layers your map can have. A Layer can be map images like what you would see in Google or Bing Maps. Or a Layer can represent the physical location of items. Layers can be toggled on and off through the IsVisible property. You can also adjust the transparency of a layer with the Opacity property. The ArcGIS Runtime SDK comes with 12 different types of map layers that you can use in your app! Some of these I’ll cover in detail in this blog, some I’ll just barely cover, and some will have whole blogs dedicated to them. I like to group the layers into two basic categories. The layers for “basic mapping” and layers for “GIS users”. I consider basic mapping to be any app in the store that uses a map in any way. Some examples would be Four Square, or Disney Expedition.  Layers for GIS users are needed ... [More]

Getting started with the ArcGIS Runtime (beta) Mapping SDK for .NET

Last Sunday (March 9) Esri announced the public beta release of their mapping SDK for .NET. This new SDK covers Windows Store, Windows Phone, and WPF. Can you believe it? All three platforms, and all using the same API. This is huge news if you develop mapping applications. Personally I find it painful that in Windows Phone 7 you would use the Bing Maps (Silverlight) SDK. In Windows Phone 8 you were encouraged to use the new Nokia Maps SDK, while on Windows Store you had the Bing Maps SDK, but it was a different SDK than the Windows Phone 7 one. So that’s three different SDKs to use. I have no idea who thought this was a sane idea. Esri has been working hard on this new SDK. During the Devsummit last year (2014), Esri announced the beta of a new SDK that would target Windows Store. At that time, they already had a Windows Phone SDK and a WPF SDK. Both were very similar with a few extras on the WPF side. While working on this new beta for Windows Store, they decided it would be much be... [More]