Files
ShrlAlgoToolkit/AntDesignWPF/Controls/AntContentControl.cs

40 lines
1.7 KiB
C#
Raw Normal View History

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