Views/ConnectionView.xaml.cs

(开头部分) 5KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MahAppsMetro.Demo.Views
{
    /// <summary>
    /// ConnectionView.xaml 的互動邏輯
    /// </summary>
    public partial class ConnectionView : UserControl
    {
        public ConnectionView()
        {
            InitializeComponent();
            Loaded += ConnectionView_Loaded;
            MouseMove += UserControl_MouseMove;
            MouseLeave += UserControl_MouseLeave;
            MouseUp += UserControl_MouseUp;
        }

        private void ConnectionView_Loaded(object sender, RoutedEventArgs e)
        {
            Init();
        }

        bool IsConnection { get; set; }
        public Polyline ConnectLine { get; set; }
        Point TempPoint { get; set; }
        bool IsLastPointInPoint { get; set; }
        List<Point> Points = new List<Point>();
        List<string> Keys = new List<string>();

        private void ellipse_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Ellipse ellipse = sender as Ellipse;
            Point p = new Point(Canvas.GetLeft(ellipse) + ellipse.Width / 2, Canvas.GetTop(ellipse) + ellipse.Height / 2);
            StartPaint(p);
        }

        private void ellipse_MouseEnter(object sender, MouseEventArgs e)
        {
            if (!IsConnection) return;
            Ellipse ellipse = sender as Ellipse;
            Point p = new Point(Canvas.GetLeft(ellipse) + ellipse.Width / 2, Canvas.GetTop(ellipse) + ellipse.Height / 2);
            IsLastPointInPoint = true;
            Paint(p);
        }

        private void UserControl_MouseUp(object sender, MouseButtonEventArgs e)
后面还有 112 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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