月更
This commit is contained in:
39
AntDesignWPF/Controls/AntContentControl.cs
Normal file
39
AntDesignWPF/Controls/AntContentControl.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// 内容的字符大小写
|
||||
/// </summary>
|
||||
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));
|
||||
|
||||
/// <summary>
|
||||
/// 确定内部 ContentPresenter 是否应在其样式中使用 AccessText
|
||||
/// </summary>
|
||||
public bool RecognizesAccessKey
|
||||
{
|
||||
get { return (bool)GetValue(RecognizesAccessKeyProperty); }
|
||||
set { SetValue(RecognizesAccessKeyProperty, value); }
|
||||
}
|
||||
|
||||
static AntContentControl()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(AntContentControl), new FrameworkPropertyMetadata(typeof(AntContentControl)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user