Reputation: 59
<Style TargetType="ComboBoxItem" x:Key="ComboBoxItemStyle">
<EventSetter Event="Selected" Handler="status_SelectionChanged"/>
</Style>
status_SelectionChanged
method:
public void status_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
MessageBox.Show("1");
}
Error: not valid System.Windows.RoutedEventHandler
why?
Upvotes: 0
Views: 145
Reputation: 50712
Try
private void status_SelectionChanged(object sender, RoutedEventArgs e)
Upvotes: 0
Reputation: 67065
I believe your method signature for SelectionChanged should use RoutedEventArgs e
instead of SelectionChangedEventArgs e
Here is the MSDN showing the RoutedEventHandler signature
Upvotes: 2