Is it possible to display a user control on the map coordinates, on a map? Say, for instance, I wanted to put a UserControl button on capitals of states in the US and if you clicked on the button, a page would load? Something to place a UserControl onto these coordinates...
Thanks!
We ended up having to take an alternative approach due to a lack of support, so this is no longer on the table.
Also, some silverlight versions have a bug with binding to attached properties. Do you see in the linked example how I redefined the namespace that contains the attached property class in the element that is binding against the attached property? This is due to a bug in the Silverlight runtime. You may need to make the same adjustment. If that doesn't help, could you share your xaml and I'll take a look at it?
Hope this helps!
-Graham
Do you get any binding errors in the output log?
*bump*
Any help?
Graham,
I've tried to follow this up and do what you posted in the other topic, but am not having any success...
I've made three DependencyProperty's in a custom class that derives from a DependencyObject.
i.e.
public class MapData : DependencyObject { public static readonly DependencyProperty IDProperty = DependencyProperty.RegisterAttached("ID", typeof(object), typeof(MapData), new PropertyMetadata(null)); public static readonly DependencyProperty StatusProperty = DependencyProperty.RegisterAttached("Status", typeof(object), typeof(MapData), new PropertyMetadata(null)); public static readonly DependencyProperty TextProperty = DependencyProperty.RegisterAttached("Text", typeof(object), typeof(MapData), new PropertyMetadata(null)); public static object GetID(DependencyObject target) { return target.GetValue(MapData.IDProperty); } public static void SetID(DependencyObject target, object value) { target.SetValue(MapData.IDProperty, value); } public static object GetStatus(DependencyObject target) { return target.GetValue(MapData.StatusProperty); } public static void SetStatus(DependencyObject target, object value) { target.SetValue(MapData.StatusProperty, value); } public static object GetText(DependencyObject target) { return target.GetValue(MapData.TextProperty); } public static void SetText(DependencyObject target, object value) { target.SetValue(MapData.TextProperty, value); } }
and when objects are added, I call MapData.SetText( element, "Some Text" );
In the XAML, I've mapped the Text of my target control in the DataTemplate to have the Binding Path=(ui:MapData.Text) -- is this correct ? (ui is the namespace of all of my custom controls, which also includes the MapData class)