示例#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;
         }
     }
 }
示例#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;
		}
示例#4
0
        private void UpdateMenuRibbon()
        {
            var p = this.LogicalParent();

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