In WPF i have a TabControl and i've attached it a SelectionChanged event handler: when i select a TabItem i load some data in a DataGrid.
The problem is that if i click on some row in the DataGrid, wpf call again the TabControl SelectionChanged. How can i deny that wpf call this event when i click on a row in the datagrid?
I've tried to identify the sender but doesn't work:
private void TabControl_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
if(sender is TabControl){
.....
.....
}
}
if i click on a row in the datagrid, it's called this handler and the sender is a TabControl. I don't understand why!!!