Hi Thanks for the reply. Please have a look at the following code. The resource dictionary has the EditorWidgetStyle (I have removed most part of it). If you look at the end I have included a custom button and with use of trigger I am attaching a click event.The click event is then handled in the PavementPerformace.cs included below. The code till here works with no problem. The click event is fired and is handled in the class. however as I described in my earlier posts how can I know the selected feature in the "Target_Click"<ResourceDictionary
<Style x:Key="EditorWidgetStyle2" TargetType="esri:EditorWidget">
...
<Grid x:Name="ToolsContainer1"
Background="{TemplateBinding Background}"
HorizontalAlignment="Center" >
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,0">
<!--SELECT BUTTON-->
<Button x:Name="Select" Command="{Binding Select}" />
<!--CUSTOM BUTTON-->
<Button x:Name="PavementPerformace" Height="40" Width="40">
<i:Interaction.Triggers >
<i:EventTrigger EventName="Click">
<local:PavementPerformace/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
</Style>
</ResourceDictionary>PavementPerformace.cs public class PavementPerformace:TargetedTriggerAction<Button>
{
protected override void Invoke(object parameter){}
protected override void OnAttached()
{
base.OnAttached();
Target.Click += new RoutedEventHandler(Target_Click);
}
void Target_Click(object sender, RoutedEventArgs e)
{
//Access selected feature and calculate pavement performance
}
protected override void OnDetaching()
{
base.OnDetaching();
Target.Click -= new RoutedEventHandler(Target_Click);
}
}