This project has moved and is read-only. For the latest updates, please go here.

Visibility of MapPanel.Location attached property when null

Feb 20, 2017 at 10:39 AM
Edited Feb 20, 2017 at 10:40 AM

I think it makes sense for the map to set element visibility to collapsed when the value of the attached property MapPanel.Location is null.

As a workaround, I'm currently using a dedicated IValueConverter which return Visibility.Collapsed for null values. But this is clumsy and annoying, I don't think there's a visual benefit for showing a geography positioned element without a valid position.

Any thoughts? Thanks!
Feb 20, 2017 at 6:43 PM
Edited Feb 20, 2017 at 6:45 PM
Sorry, but that doesn't make any sense at all.

Since it is an attached property, it has a value on any element that you query for a value, even those where you've never set it. If no value is set, the MapPanel.GetLocation method returns the default value null. And you certainly agree that you don't want to collapse every element without a Location, e.g. every MapPanel.

So your value converter is the way to go.
Marked as answer by ClemensF on 2/20/2017 at 12:47 PM
Feb 28, 2017 at 8:02 AM
Yeah, I mean only if the attached property is explicitly set on the element, and it's null.

Isn't there a way to check whether an attached property is actually explicitly set?