Hello,
I need to create a custom UserControl that can respond to the Map_ExtentChanged event.
In my class I have the following code:
public static readonly DependencyProperty MapProperty = DependencyProperty.RegisterAttached(
"Map",
typeof(ESRI.ArcGIS.Client.Map),
typeof(NavigationWidget),
new PropertyMetadata(OnMapPropertyChanged));
public Map Map
{
get { return GetValue(MapProperty) as Map; }
set { SetValue(MapProperty, value); }
}
private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((NavigationWidget)d).Map.ExtentChanged +=new EventHandler<ExtentEventArgs>(Map_ExtentChanged);
}
private static void Map_ExtentChanged(object sender, ExtentEventArgs e) {}
Did I implement this right?
Thanks,
Jason