コード例 #1
0
        public override void UpdateVisual(RadialSegment segment, double startAngle)
        {
            if (segment == null || !segment.TargetItem.CanNavigate || segment.LayoutSlot == RadialLayoutSlot.Invalid)
            {
                return;
            }

            NavigationItemButton navigationButton = this.navigationButtons[segment.TargetItem.Index];

            navigationButton.StartAngle = startAngle;
            navigationButton.UpdateVisualsState();
        }
コード例 #2
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()
        {
            this.arrowGlyph.RenderTransformOrigin = new Point(0, 0);
            this.arrowGlyph.RenderTransform       = new RotateTransform()
            {
                Angle = ((90 - this.model.LayoutSlot.SweepAngle / 2) - this.StartAngle) - this.Model.TargetItem.Index * 45
            };

            this.itemPath.Data = NavigationItemButton.GetNavigationButtonArc(this.Model);
            this.ArrangeArrowGlyph();

            base.OnTemplateApplied();
        }
コード例 #3
0
        internal void UpdateVisualsState()
        {
            if (!this.IsTemplateApplied)
            {
                return;
            }
            this.itemPath.Data = NavigationItemButton.GetNavigationButtonArc(this.Model);

            this.arrowGlyph.RenderTransform = new RotateTransform()
            {
                Angle = (90 - this.model.LayoutSlot.SweepAngle / 2.0 - this.StartAngle) - this.Model.TargetItem.Index * 45
            };

            this.ArrangeArrowGlyph();
        }
コード例 #4
0
        public override void ShowVisual(RadialSegment segmentModel, double startAngle)
        {
            if (segmentModel == null || !segmentModel.TargetItem.CanNavigate || segmentModel.LayoutSlot == RadialLayoutSlot.Invalid)
            {
                return;
            }

            NavigationItemButton navigationButton = this.navigationButtons[segmentModel.TargetItem.Index];

            navigationButton.StartAngle = startAngle;
            navigationButton.ResetVisualState();

            segmentModel.Visual         = navigationButton;
            navigationButton.Model      = segmentModel;
            navigationButton.Visibility = Visibility.Visible;
            segmentModel.Visual         = navigationButton;

            navigationButton.UpdateVisualsState();
        }