Exemplo n.º 1
0
 private void SetCurrentItemIn(IRadialMenuItemsControl currentItem)
 {
     CurrentItem = currentItem;
     if (CurrentItem == this)
     {
         _navigationButton.Content = this.NavigationButtonIcon ?? (char)0xE115;
     }
     else
     {
         if (CurrentItem is RadialNumericMenuItem)
         {
             _navigationButton.GoToStateNumeric();
         }
         else
         {
             _navigationButton.GoToStateExpand();
         }
         _navigationButton.Content = this.NavigationButtonBackIcon ?? (char)0xE2A6;
     }
 }
Exemplo n.º 2
0
        internal void SetCurrentItem(IRadialMenuItemsControl currentItem)
        {
            if (lowerThan14393)
            {
                if (close != null)
                {
                    EventHandler <object> handler = null;
                    handler = new EventHandler <object>((s1, e1) =>
                    {
                        close.Completed -= handler;
                        SetCurrentItemIn(currentItem);
                        open?.Begin();
                    });
                    close.Completed += handler;
                    close.Begin();
                }
                else
                {
                    SetCurrentItemIn(currentItem);
                }
            }
            else
            {
                var batch = _compositor.GetCommitBatch(CompositionBatchTypes.Animation);
                batch.Completed += (s, e) =>
                {
                    SetCurrentItemIn(currentItem);

                    scaleAnimation.Duration = TimeSpan.FromSeconds(0.1);
                    if (!lowerThan14393)
                    {
                        scaleAnimation.Direction = AnimationDirection.Normal;
                    }
                    _contentGridVisual.StartAnimation(nameof(_contentGridVisual.Scale), scaleAnimation);
                };

                scaleAnimation.Duration  = TimeSpan.FromSeconds(0.07);
                scaleAnimation.Direction = AnimationDirection.Reverse;
                _contentGridVisual.StartAnimation(nameof(_contentGridVisual.Scale), scaleAnimation);
            }
        }
Exemplo n.º 3
0
 internal void SetMenu(RadialMenu menu)
 {
     _menu       = menu;
     _parentItem = menu?.CurrentItem;
 }