Views/AnimationView1.xaml.cs

(开头部分) 7KB

这里只显示每个文件的开头 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>
    /// AnimationView1.xaml 的互動邏輯
    /// </summary>
    public partial class AnimationView1 : UserControl
    {
        double Radian = Math.PI / 180;
        bool hasSetBinding = false;
        int R = 150;

        public AnimationView1()
        {
            InitializeComponent();
        }

        private void btn1_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder xaml = new StringBuilder();
            canvas.Children.Clear();
            storyboard.Children.Clear();
            try
            {
                for (int angle = 0, i = 0; angle < 360; angle += 15)
                {
                    int tempAngle = angle;
                    Line line = new Line() { Stroke = Brushes.Red, StrokeThickness = 3, X2 = R, Y2 = R, RenderTransform = new RotateTransform(), SnapsToDevicePixels = true };
                    
                    switch (i++)
                    {
                        case 1: line.Stroke = Brushes.Orange;break;
                        case 2:line.Stroke = Brushes.Yellow;break;
                        case 3: line.Stroke = Brushes.Green; break;
                        case 4: line.Stroke = Brushes.Aqua; break;
                        case 5: line.Stroke = Brushes.Blue; break;
                        case 6: line.Stroke = Brushes.Purple; i = 0; break;
                        default:
                            break;
                    }

                    if(angle == 0)
                    {
                        line.X1 = R;
                        line.Y1 = 0;
                        line.RenderTransformOrigin = new Point(1,0);
后面还有 110 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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