Ejemplo n.º 1
0
        /// <summary>
        /// Occurs when the <see cref="M:OnApplyTemplate" /> method has been called and the template is already successfully applied.
        /// </summary>
        protected override void OnTemplateApplied()
        {
            base.OnTemplateApplied();

            this.CalculateRingsAspectRatio();

            this.model.InitializeLayers();

            this.model.UpdateItemsSelection(this.Items);

            if (this.IsOpen)
            {
                this.openRequested = true;
            }

            this.tooltip            = new Popup();
            this.menuToolTipContent = new MenuToolTip();
            this.tooltip.Child      = this.menuToolTipContent;

            this.panel.Children.Add(this.tooltip);
            this.menuToolTipContent.Transitions = new TransitionCollection();

            this.menuToolTipContent.Transitions.Add(new PopupThemeTransition()
            {
                FromHorizontalOffset = 0, FromVerticalOffset = 0
            });

            this.menuToolTipContent.Owner = this;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RadRadialMenu"/> class.
        /// </summary>
        public RadRadialMenu()
        {
            this.DefaultStyleKey = typeof(RadRadialMenu);

            this.model              = new RadialMenuModel(this);
            this.hitTestService     = new HitTestService(this);
            this.visualstateService = new VisualStateService(this);
            this.commandService     = new CommandService(this);
            this.SizeChanged       += this.OnRadRadialMenuSizeChanged;

            this.tooltip            = new Popup();
            this.menuToolTipContent = new MenuToolTip();
            this.tooltip.Child      = this.menuToolTipContent;
        }