Esempio n. 1
0
        static ManagedPopup()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ManagedPopup), new FrameworkPropertyMetadata(typeof(ManagedPopup)));

            // PopupのIsOpenプロパティ更新のイベントハンドラを設定する。
            IsOpenProperty.OverrideMetadata(typeof(ManagedPopup), new FrameworkPropertyMetadata(IsOpenChanged));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        /// <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));
        }
Esempio n. 4
0
 static StaysOpenContextMenu()
 {
     IsOpenProperty.OverrideMetadata(
         typeof(StaysOpenContextMenu),
         new FrameworkPropertyMetadata(false, null, CoerceIsOpen));
     StaysOpenProperty.OverrideMetadata(
         typeof(StaysOpenContextMenu),
         new FrameworkPropertyMetadata(false, PropertyChanged, CoerceStaysOpen));
 }
Esempio n. 5
0
        /// <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));
        }
Esempio n. 7
0
 /// <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));
 }
Esempio n. 8
0
 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));
 }
Esempio n. 9
0
 static PopupEx()
 {
     IsOpenProperty.OverrideMetadata(typeof(PopupEx), new FrameworkPropertyMetadata(OnIsOpenPropertyChanged));
 }
Esempio n. 10
0
        static MenuFlyoutPresenter()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MenuFlyoutPresenter), new FrameworkPropertyMetadata(typeof(MenuFlyoutPresenter)));

            IsOpenProperty.OverrideMetadata(typeof(MenuFlyoutPresenter), new FrameworkPropertyMetadata(OnIsOpenChanged));
        }