WPF 实现火炬效果 |
您所在的位置:网站首页 › verticalalignment=bottom › WPF 实现火炬效果 |
WPF开发者QQ群: 340500857 | 微信群 -> 进入公众号主页 加入组织 欢迎转发、分享、点赞、在看,谢谢~。 01 — 效果预览 02 — 代码如下 一、FireControl.cs 代码如下 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; namespace WPFDevelopers.Controls { public class FireControl : Control { static FireControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(FireControl), new FrameworkPropertyMetadata(typeof(FireControl))); } public bool IsStart { get { return (bool)GetValue(IsStartProperty); } set { SetValue(IsStartProperty, value); } } // Using a DependencyProperty as the backing store for IsStart. This enables animation, styling, binding, etc... public static readonly DependencyProperty IsStartProperty = DependencyProperty.Register("IsStart", typeof(bool), typeof(FireControl), new PropertyMetadata(default(bool))); } }二、OtherControl.xaml 代码如下 三、OtherControlExample.xaml 代码如下 源码地址 github:https://github.com/yanjinhuagood/WPFDevelopers.git gitee:https://gitee.com/yanjinhua/WPFDevelopers.git WPF开发者QQ群: 340500857 Github:https://github.com/yanjinhuagood 版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。 转载请著名作者 出处 https://github.com/yanjinhuagood |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |