namespace AntDesignWPF.Controls { using System.Windows; using System.Windows.Controls; public class AntContentControl : ContentControl { public static readonly DependencyProperty ContentCharacterCasingProperty = DependencyProperty.Register("ContentCharacterCasing", typeof(CharacterCasing), typeof(AntContentControl), new FrameworkPropertyMetadata(CharacterCasing.Normal, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsMeasure), value => CharacterCasing.Normal <= (CharacterCasing)value && (CharacterCasing)value <= CharacterCasing.Upper); /// /// 内容的字符大小写 /// public CharacterCasing ContentCharacterCasing { get { return (CharacterCasing)GetValue(ContentCharacterCasingProperty); } set { SetValue(ContentCharacterCasingProperty, value); } } public static readonly DependencyProperty RecognizesAccessKeyProperty = DependencyProperty.Register("RecognizesAccessKey", typeof(bool), typeof(AntContentControl), new FrameworkPropertyMetadata(false)); /// /// 确定内部 ContentPresenter 是否应在其样式中使用 AccessText /// public bool RecognizesAccessKey { get { return (bool)GetValue(RecognizesAccessKeyProperty); } set { SetValue(RecognizesAccessKeyProperty, value); } } static AntContentControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(AntContentControl), new FrameworkPropertyMetadata(typeof(AntContentControl))); } } }