<esri:Legend Map="{Binding ElementName=MyMap}"[INDENT]LayerItemsMode="Tree"> <i:Interaction.Triggers>[/INDENT] [INDENT=2]<i:EventTrigger EventName="Refreshed" >[/INDENT] [INDENT=3]<Commands:InvokeCommandActionWithArgs Command="{Binding LegendRefreshedCommand}" />[/INDENT] [INDENT=2]</i:EventTrigger>[/INDENT] [INDENT]</i:Interaction.Triggers>[/INDENT] </esri:Legend>
public class InvokeCommandActionWithArgs : TriggerAction<DependencyObject> { public static DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(InvokeCommandActionWithArgs)); public ICommand Command { get { return GetValue(CommandProperty) as ICommand; } set { SetValue(CommandProperty, value); } } protected override void Invoke(object parameter) { if (Command == null) return; Command.Execute(parameter); } }
Mike,Thanks for your response. I considered handling the legend refreshed event, however I am using MVVM and that approach does not work well with the pattern. I may have a way to get around the MVVM issue, but it's not ideal. Do you have any suggestions on how to handle the event while maintaining strict adherence to MVVM (no code-behind)?Thanks,Cory
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.