public static void DropDownChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuHuoSkillButton button = d as GuHuoSkillButton; if (button != null) { button.popupChoices.IsOpen = ((bool)e.NewValue); } }