I have a TabControl in WPF. I want to find an event that occurs when changing tabs. What is the name of this event?
The TabControl
inherits from a Selector
which contains the SelectionChanged
event.
<TabControl SelectionChanged="OnSelectionChanged" ... />
private void OnSelectionChanged(Object sender, SelectionChangedEventArgs args)
{
var tc = sender as TabControl; //The sender is a type of TabControl...
if (tc != null)
{
var item = tc.SelectedItem;
//Do Stuff ...
}
}