packages/MaterialDesignThemes.2.5.1/src/net45/Chip.cs

(开头部分) 4KB

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

using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;

namespace MaterialDesignThemes.Wpf
{
    [TemplatePart(Name = DeleteButtonPartName, Type = typeof(Button))]
    public class Chip : ButtonBase
    {
        private ButtonBase _deleteButton;

        public const string DeleteButtonPartName = "PART_DeleteButton";

        static Chip()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Chip), new FrameworkPropertyMetadata(typeof(Chip)));
        }

        public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
            "Icon", typeof (object), typeof (Chip), new PropertyMetadata(default(object)));

        public object Icon
        {
            get { return (object) GetValue(IconProperty); }
            set { SetValue(IconProperty, value); }
        }

        public static readonly DependencyProperty IconBackgroundProperty = DependencyProperty.Register(
            "IconBackground", typeof (Brush), typeof (Chip), new PropertyMetadata(default(Brush)));

        public Brush IconBackground
        {
            get { return (Brush) GetValue(IconBackgroundProperty); }
            set { SetValue(IconBackgroundProperty, value); }
        }

        public static readonly DependencyProperty IconForegroundProperty = DependencyProperty.Register(
            "IconForeground", typeof (Brush), typeof (Chip), new PropertyMetadata(default(Brush)));

        public Brush IconForeground
        {
            get { return (Brush) GetValue(IconForegroundProperty); }
            set { SetValue(IconForegroundProperty, value); }
        }
    
        public static readonly DependencyProperty IsDeletableProperty = DependencyProperty.Register(
            "IsDeletable", typeof (bool), typeof (Chip), new PropertyMetadata(default(bool)));

        /// <summary>
        /// Indicates if the delete button should be visible.
        /// </summary>
        public bool IsDeletable
        {
            get { return (bool) GetValue(IsDeletableProperty); }
            set { SetValue(IsDeletableProperty, value); }
        }

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

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

AI 解读 AI

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

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