private void OnExpanderGotFocus(object sender, RoutedEventArgs e) { CancelGotFocusBubble = true; // Activate the selection IsSelectionActive = true; UpdateVisualState(true); }