static ManagedPopup() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ManagedPopup), new FrameworkPropertyMetadata(typeof(ManagedPopup))); // PopupのIsOpenプロパティ更新のイベントハンドラを設定する。 IsOpenProperty.OverrideMetadata(typeof(ManagedPopup), new FrameworkPropertyMetadata(IsOpenChanged)); }
static Flyout() { StaysOpenProperty.OverrideMetadata(typeof(Flyout), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(Flyout), new FrameworkPropertyMetadata(true)); PopupAnimationProperty.OverrideMetadata(typeof(Flyout), new FrameworkPropertyMetadata(PopupAnimation.Slide)); IsOpenProperty.OverrideMetadata(typeof(Flyout), new FrameworkPropertyMetadata(IsOpenPropertyChangedCallback, IsOpenCoerceValueCallback)); }
/// <summary> /// Initializes static members of the RibbonToolTip class. This overrides /// the default style. /// </summary> static RibbonToolTip() { Type ownerType = typeof(RibbonToolTip); DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType)); IsOpenProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new PropertyChangedCallback(OnIsOpenChanged), new CoerceValueCallback(CoerceIsOpen))); PlacementTargetProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(OnPlacementTargetPropertyChanged)); }
static StaysOpenContextMenu() { IsOpenProperty.OverrideMetadata( typeof(StaysOpenContextMenu), new FrameworkPropertyMetadata(false, null, CoerceIsOpen)); StaysOpenProperty.OverrideMetadata( typeof(StaysOpenContextMenu), new FrameworkPropertyMetadata(false, PropertyChanged, CoerceStaysOpen)); }
/// <summary> /// Initializes static members of the RibbonContextMenu class. /// </summary> static RibbonContextMenu() { Type ownerType = typeof(RibbonContextMenu); DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType)); IsOpenProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new PropertyChangedCallback(OnIsOpenChanged))); EventManager.RegisterClassHandler(ownerType, Mouse.PreviewMouseDownOutsideCapturedElementEvent, new MouseButtonEventHandler(OnClickThroughThunk)); ItemsPanelTemplate template = new ItemsPanelTemplate(new FrameworkElementFactory(typeof(RibbonMenuItemsPanel))); template.Seal(); ItemsPanelProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(template)); }
static EntryPopup() { // Autocomplete is a popup in a popup and when you go to click the other popup, this one might close // so we need to hack around this otherwise uncontrollable behavior (StaysOpen has no effect). var existing = IsOpenProperty.GetMetadata(typeof(Popup)); PropertyChangedCallback callback = (o, e) => { if ((bool)e.NewValue || ((EntryPopup)o).CanClose()) { existing.PropertyChangedCallback(o, e); } }; IsOpenProperty.OverrideMetadata(typeof(EntryPopup), new FrameworkPropertyMetadata(existing.DefaultValue, callback, existing.CoerceValueCallback)); }
/// <summary> /// Initializes the <see cref="NotifierButton"/> class. /// </summary> static NotifierButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(NotifierButton), new FrameworkPropertyMetadata(typeof(NotifierButton))); IsOpenProperty.OverrideMetadata(typeof(NotifierButton), new FrameworkPropertyMetadata(false, OnIsOpenChanged)); }
static ContextMenu() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ContextMenu), new FrameworkPropertyMetadata(typeof(ContextMenu))); IsOpenProperty.OverrideMetadata(typeof(ContextMenu), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsOpenChanged, CoerceIsOpen)); FocusVisualStyleProperty.OverrideMetadata(typeof(ContextMenu), new FrameworkPropertyMetadata(null)); }
static PopupEx() { IsOpenProperty.OverrideMetadata(typeof(PopupEx), new FrameworkPropertyMetadata(OnIsOpenPropertyChanged)); }
static MenuFlyoutPresenter() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuFlyoutPresenter), new FrameworkPropertyMetadata(typeof(MenuFlyoutPresenter))); IsOpenProperty.OverrideMetadata(typeof(MenuFlyoutPresenter), new FrameworkPropertyMetadata(OnIsOpenChanged)); }