Example #1
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     this.OnKeyDownNavigate(e);
     base.OnKeyDown(e);
     if (!e.Handled)
     {
         switch (e.Key)
         {
         case Key.Up:
         case Key.Down:
             if (MenuRibbon != null && MenuRibbon.RibbonDisplay == RibbonDisplay.Drop)
             {
                 var c = MenuRibbon.DroppedRibbonItem.Content.FirstFocusableElement();
                 if (c == null)
                 {
                     var p = MenuRibbon.VisualChildren().Where(x => (string)x.GetValue(FrameworkElement.NameProperty) == "PART_Popup").FirstOrDefault() as Popup;
                     if (p != null)
                     {
                         c = p.Child.FirstFocusableElement();
                     }
                 }
                 if (c != null)
                 {
                     c.Focus();
                     e.Handled = true;
                 }
             }
             break;
         }
     }
 }
Example #2
0
 void OnClicks(Tuple <MouseButtonEventArgs, int> x)
 {
     if (MenuRibbon != null && x.Item2 % 2 == 0)
     {
         MenuRibbon.TogglePin();
     }
 }
		private void UpdateMenuRibbon()
		{
			var p = this.LogicalParent();
			while (p is RibbonItem)
				p = p.LogicalParent();
			MenuRibbon = p as MenuRibbon;
		}
Example #4
0
        private void UpdateMenuRibbon()
        {
            var p = this.LogicalParent();

            while (p is RibbonItem)
            {
                p = p.LogicalParent();
            }
            MenuRibbon = p as MenuRibbon;
        }
Example #5
0
 public TogglePinCmd(MenuRibbon ribbon)
 {
     this.ribbon = ribbon;
 }
Example #6
0
 void IPopupItem.Action()
 {
     MenuRibbon.TogglePin();
 }
			public TogglePinCmd(MenuRibbon ribbon)
			{
				this.ribbon = ribbon;
			}