As Dominique mentioned we have several toolkit samples that do this. It might be best to see them in action during debug so you can better understand how the map is passed to the controls.
So if you have a different UserControl for your attribute query (i.e. AttributeQueryControl), you will need to define a Map as DependencyProperty like this:
// Map to print (Dependency Property)
public ESRI.ArcGIS.Client.Map Map
{
get { return (ESRI.ArcGIS.Client.Map)GetValue(MapProperty); }
set { SetValue(MapProperty, value); }
}
public static readonly DependencyProperty MapProperty = DependencyProperty.Register("Map", typeof(ESRI.ArcGIS.Client.Map), typeof(AttributeQueryControl), new PropertyMetadata(null, OnMapChanged));
private static void OnMapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as AttributeQueryControl;
var newMap = e.NewValue as ESRI.ArcGIS.Client.Map;
// Do what you need to do with the map here.
}
Which you can then later you use like this:
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:GraphicsLayer ID="MyGraphicsLayer" />
</esri:Map>
<local:AttributeQueryControl x:Name="MyControl" Map="{Binding ElementName=MyMap}" VerticalAlignment="Center" HorizontalAlingment="Center"/>