private static void OnAttributesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ((Popup)d).UpdateTemplate(); }