Views/RadialPanel.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;

namespace MahAppsMetro.Demo.Views
{
    /// <summary>
    /// 双圆
    /// 全圆面板、左半圆面板、上半圆面板、右半圆、下半圆
    /// 顺时针、逆时针
    /// 可收扇开扇
    /// 可拖拽
    /// 可隐藏
    /// </summary>
    public class RadialPanel : Panel
    {
        public static readonly DependencyProperty OrientationProperty;

        bool showPieLines;
        double angleEach;       // 角度
        Size sizeLargest;       // 最大孩子的尺寸  
        double radius;

        // 圆的半径
        double outerEdgeFromCenter;
        double innerEdgeFromCenter;

        static RadialPanel()
        {
            OrientationProperty = DependencyProperty.Register("Orientation", typeof(RadialPanelOrientation), typeof(RadialPanel),
                    new FrameworkPropertyMetadata(RadialPanelOrientation.ByWidth, FrameworkPropertyMetadataOptions.AffectsMeasure));
        }

        public RadialPanelOrientation Orientation
        {
            set { SetValue(OrientationProperty, value); }
            get { return (RadialPanelOrientation)GetValue(OrientationProperty); }
        }

        public bool ShowPieLines
        {
            set
            {
                if (value != showPieLines)
                    InvalidateVisual();

                showPieLines = value;
            }
            get
            {
                return showPieLines;
            }
        }

        protected override Size MeasureOverride(Size sizeAvailable)
        {
            if (InternalChildren.Count == 0)
后面还有 109 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。