Agree with Jennifer. Expose properties like Layers from your view model (not UI elements like a map control) and bind to those.One workaround for properties like Map.Extent that will not support binding is attached properties. Create an attached property (maybe BindableExtent) and bind that to your view model. In the callback for the property change, do some work to set the actual map extent.Quick and dirty example:
public static readonly DependencyProperty BindableExtentProperty = DependencyProperty.RegisterAttached("BindableExtent", typeof(Geometry), typeof(OwnerClass), new PropertyMetadata(new PropertyChangedCallback(OnBindableExtentChanged)));
public static Geometry GetBindableExtent(DependencyObject d)
{
return (Geometry)d.GetValue(BindableExtentProperty);
}
public static void SetBindableExtent(DependencyObject d, Geometry value)
{
d.SetValue(BindableExtentProperty, value);
}
private static void OnBindableExtentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Map map = d as Map;
var newExtent = (Geometry)e.NewValue;
map.ZoomTo(newExtent);
}