DsfDemo/MainWindow.xaml.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Media.Media3D;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DsfDemo
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            ratio1.ValueChanged += Ratio1_ValueChanged;
            this.MouseMove += MainWindow_MouseMove;
            DataContext = this;
            new TestWindow().Focus();
        }

        DateTime LastAnimate = DateTime.Now;

        private void MainWindow_MouseMove(object sender, MouseEventArgs e)
        {
            if ((DateTime.Now - LastAnimate).TotalMilliseconds < 120) return;
            var center = new Point(Width / 2, Height / 2);
            var pos = e.GetPosition(this);
            var xTo = (pos.Y - center.Y) / Height * 2 * 30;
            var yTo = (pos.X - center.X) / Width * 2 * 30;
            var animationX = new DoubleAnimation
            {
                To = xTo,
                Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100)),
                //EasingFunction = new QuadraticEase()
            };
            var animationY = new DoubleAnimation
            {
                To = yTo,
                Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100)),
                EasingFunction = new QuadraticEase()
            };
            hori.Value = horibar.Value = rotatebar.Value = (pos.X - center.X) / Width * 2 * 100;
            slide.Value = Math.Abs(hori.Value);
            p2.Value =  hori.Value / 2 + 50;
            label.Content = hori.Value.ToString();
            vertibar.Value = bat.Value = verti2.Value = verti.Value / 2 + 50;
            verti.Value = (center.Y - pos.Y) / Height * 2 * 100;
后面还有 13 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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