LunarMind/LMETools/DemoResourceButton.cs

(开头部分) 4KB

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

using SHomeWorkshop.LunarMind.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace SHomeWorkshop.LunarMind.LMETools
{
    public class DemoResourceButton : ToggleButton
    {
        public DemoResourceButton(GraphicDemonstrator demoWin, DemoResourceInfo resourceInfo, Canvas mainCanvas)
        {
            this.Background = Brushes.Transparent;
            this.ResourceInfo = resourceInfo;
            this.ResourceCard = new DemoResourceCard(demoWin, this)
            {
                Visibility = System.Windows.Visibility.Collapsed,
                Title = resourceInfo.LinkTitle,
                WindowStartupLocation = System.Windows.WindowStartupLocation.Manual,
                ShowInTaskbar = false,
            };

            spBase.Children.Add(imgType);
            spBase.Children.Add(tbTitle);

            if (resourceInfo.LinkType == "Html")
            {
                imgType.Source = htmlTag;
            }
            else  // Image
            {
                imgType.Source = pictureTag;
            }

            tbTitle.Text = resourceInfo.LinkTitle;

            this.Content = spBase;

            this.mainCanvas = mainCanvas;

            this.Click += DemoResourceButton_Click;
        }

        static DemoResourceButton()
        {
            htmlTag = new BitmapImage(new Uri("pack://application:,,,/LunarMind;component/Resources/htmltag.png"));
            pictureTag = new BitmapImage(new Uri("pack://application:,,,/LunarMind;component/Resources/picturetag.png"));
        }

        private static BitmapImage htmlTag;

        private static BitmapImage pictureTag;

        private StackPanel spBase = new StackPanel() { Orientation = Orientation.Horizontal, };

后面还有 81 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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