Ejemplo n.º 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (popupBtn != null)
            {
                popupBtn.PopupOpened -= OnPopupOpenend;
            }
            popupBtn = GetTemplateChild(partPopupupBtn) as RibbonDropDownButton;
            if (popupBtn != null)
            {
                popupBtn.PopupOpened += new RoutedEventHandler(OnPopupOpenend);
            }

            if (wrapPanel != null)
            {
                wrapPanel.Children.Clear();
            }
            wrapPanel = GetTemplateChild(partWrapPanel) as Panel;
            if (wrapPanel == null)
            {
                throw new ArgumentNullException(partWrapPanel);
            }

            itemsPresenter = GetTemplateChild(partItemsPresenter) as FrameworkElement;
            if (wrapPanel == null)
            {
                throw new ArgumentNullException(partItemsPresenter);
            }
            AttachThumbnailsToPanel();
        }
Ejemplo n.º 2
0
 private static void Reset()
 {
     if (elements != null)
     {
         RibbonDropDownButton.CloseOpenedPopup(null);
         RibbonGroup.CloseOpenedPopup();
         HideQuickAccessKeys();
     }
 }
Ejemplo n.º 3
0
        static void IsDropDownPressedPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            bool newValue            = (bool)e.NewValue;
            RibbonDropDownButton btn = d as RibbonDropDownButton;

            if (newValue)
            {
                Mouse.Capture(btn, CaptureMode.SubTree);
            }
            btn.OnDropDownPressedChanged((bool)e.OldValue, (bool)e.NewValue);
        }
Ejemplo n.º 4
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();


            appButton              = GetTemplateChild(partAppButton) as RibbonDropDownButton;
            appButtonClone         = GetTemplateChild(partAppButtonClone) as FrameworkElement;
            appButton.PopupOpened += new RoutedEventHandler(appButton_PopupOpened);
            appButton.PopupClosed += new RoutedEventHandler(appButton_PopupClosed);

            recentItemsList = GetTemplateChild(partRecentItemsList) as FrameworkElement;
        }
Ejemplo n.º 5
0
 private static void MoveBack()
 {
     selectStack.Pop();
     current     = selectStack.Count > 0 ? selectStack.Pop() : null;
     elements    = null;
     keySequence = "";
     Keyboard.Focus(null);
     RibbonDropDownButton.CloseOpenedPopup(null);
     RibbonGroup.CloseOpenedPopup();
     CloseQuickAccessKeys();
     if (current != null)
     {
         ShowQuickAccessKeys(current);
     }
 }
Ejemplo n.º 6
0
        public static void CloseOpenedPopup(RibbonDropDownButton caller)
        {
            RibbonDropDownButton btn = DroppedDownButton;

            if (btn != null && (btn != caller))
            {
                FrameworkElement parent = btn.Popup != null ? btn.Popup.Child as FrameworkElement : btn;
                if (!parent.IsLogicalAncestorOf(caller))
                {
                    if (btn.Popup != null)
                    {
                        btn.Popup.IsOpen = false;
                    }
                    btn.IsDropDownPressed = false;
                }
            }
            DroppedDownButton = caller;
        }
Ejemplo n.º 7
0
		public override void OnApplyTemplate()
		{
			base.OnApplyTemplate();

			if (popupBtn != null)
			{
				popupBtn.PopupOpened -= OnPopupOpenend;
			}
			popupBtn = GetTemplateChild(partPopupupBtn) as RibbonDropDownButton;
			if (popupBtn != null)
			{
				popupBtn.PopupOpened += OnPopupOpenend;
			}

			if (wrapPanel != null)
				wrapPanel.Children.Clear();
			wrapPanel = GetTemplateChild(partWrapPanel) as Panel;
			if (wrapPanel == null)
				throw new ArgumentNullException(partWrapPanel);

			itemsPresenter = GetTemplateChild(partItemsPresenter) as FrameworkElement;
			if (wrapPanel == null)
				throw new ArgumentNullException(partItemsPresenter);
			AttachThumbnailsToPanel();
		}
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();


            appButton = GetTemplateChild(partAppButton) as RibbonDropDownButton;
            appButtonClone = GetTemplateChild(partAppButtonClone) as FrameworkElement;
            appButton.PopupOpened += new RoutedEventHandler(appButton_PopupOpened);
            appButton.PopupClosed += new RoutedEventHandler(appButton_PopupClosed);

            recentItemsList = GetTemplateChild(partRecentItemsList) as FrameworkElement;
        }
Ejemplo n.º 9
0
 public static void CloseOpenedPopup(RibbonDropDownButton caller)
 {
     RibbonDropDownButton btn = DroppedDownButton;
     if (btn != null && (btn != caller))
     {
         FrameworkElement parent = btn.Popup != null ? btn.Popup.Child as FrameworkElement : btn;
         if (!parent.IsLogicalAncestorOf(caller))
         {
             if (btn.Popup != null) btn.Popup.IsOpen = false;
             btn.IsDropDownPressed = false;
         }
     }
     DroppedDownButton = caller;
 }
Ejemplo n.º 10
0
        private static void OnCommandPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonDropDownButton btn = (RibbonDropDownButton)d;

            btn.OnCommandChanged(btn, (ICommand)e.OldValue, (ICommand)e.NewValue);
        }