// Token: 0x06004280 RID: 17024 RVA: 0x00130C18 File Offset: 0x0012EE18 private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Button button = (Button)d; if (button.IsDefault) { button.UpdateIsDefaulted(Keyboard.FocusedElement); } }
private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { // This value is cached in FE, so all we have to do here is look at the new value Button b = ((Button)d); // If it's not a default button we don't need to update the IsDefaulted property if (b.IsDefault) { b.UpdateIsDefaulted(Keyboard.FocusedElement); } }
// Token: 0x0600427F RID: 17023 RVA: 0x00130B8C File Offset: 0x0012ED8C private static void OnIsDefaultChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Button button = d as Button; KeyboardFocusChangedEventHandler keyboardFocusChangedEventHandler = Button.FocusChangedEventHandlerField.GetValue(button); if (keyboardFocusChangedEventHandler == null) { keyboardFocusChangedEventHandler = new KeyboardFocusChangedEventHandler(button.OnFocusChanged); Button.FocusChangedEventHandlerField.SetValue(button, keyboardFocusChangedEventHandler); } if ((bool)e.NewValue) { AccessKeyManager.Register("\r", button); KeyboardNavigation.Current.FocusChanged += keyboardFocusChangedEventHandler; button.UpdateIsDefaulted(Keyboard.FocusedElement); return; } AccessKeyManager.Unregister("\r", button); KeyboardNavigation.Current.FocusChanged -= keyboardFocusChangedEventHandler; button.UpdateIsDefaulted(null); }
private static void OnIsDefaultChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Button b = d as Button; KeyboardFocusChangedEventHandler focusChangedEventHandler = FocusChangedEventHandlerField.GetValue(b); if (focusChangedEventHandler == null) { focusChangedEventHandler = new KeyboardFocusChangedEventHandler(b.OnFocusChanged); FocusChangedEventHandlerField.SetValue(b, focusChangedEventHandler); } if ((bool)e.NewValue) { AccessKeyManager.Register("\x000D", b); KeyboardNavigation.Current.FocusChanged += focusChangedEventHandler; b.UpdateIsDefaulted(Keyboard.FocusedElement); } else { AccessKeyManager.Unregister("\x000D", b); KeyboardNavigation.Current.FocusChanged -= focusChangedEventHandler; b.UpdateIsDefaulted(null); } }