For today's challenge....ZoomToLayerAction.I'm having trouble with using an EventTrigger to fire the esri:ZoomToLayerAction. I'm trying to implement this in the menu template so that each layer in the menu has a "Zoom To Layer" button associated with it. I've succeeded in getting the Layer Actions sample to work http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LayerActions). But I'm having trouble getting it to work in my application within the menu template. In order to get the sample to work I had to uninstall all of the Expressions Blend installations and reinstally the Blend 4 SDK. I also upgraded the API to 2.2 from 2.1. I don't get any compile errors.Here's the code from my legend template:<esri:Legend.MapLayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}"
>
</CheckBox>
<Image Height="15" Width="15" Source="/PlacePlay1;component/Assets/Images/InfoTag.png" MouseLeftButtonDown="Image_MouseLeftButtonDown" Tag="{Binding Label}" />
<StackPanel>
<Button Content="Zoom" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esri:ZoomToLayerAction LayerID="MyFeatureLayer" TargetName="MyMap" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
<Image Source="{Binding ImageSource}" VerticalAlignment="Center" Height="20" Width="20" Margin="2,0"/>
</StackPanel>
</DataTemplate>
</esri:Legend.MapLayerTemplate>
Right now I'm just using the same MyFeatureLayer as is used in the sample. The layer is in my map and it is displayed correctly. When I click on any of the resulting Zoom To Layer buttons in the legend I get the following error in the IE error window:"Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; MS STORE DMC2.6.3411.2)Timestamp: Thu, 30 Jun 2011 21:22:07 UTCMessage: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.NullReferenceException: Object reference not set to an instance of an object. at ESRI.ArcGIS.Client.Actions.ZoomToLayerAction.Invoke(Object parameter) at System.Windows.Interactivity.TriggerAction.CallInvoke(Object parameter) at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter) at System.Windows.Interactivity.EventTriggerBase.OnEvent(EventArgs eventArgs) at System.Windows.Interactivity.EventTriggerBase.OnEventImpl(Object sender, EventArgs eventArgs) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) Line: 56Char: 13Code: 0URI: http://localhost:4677/PlacePlay1TestPage.aspx"An error message also pops up (See attached graphic).Any thoughts?-T