Files
ShrlAlgoToolkit/AntdWpf/Controls/ContentControl.cs
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

41 lines
1.7 KiB
C#

namespace AntdWpf.Controls
{
using System.Windows;
using System.Windows.Controls;
using ContentControlBase = System.Windows.Controls.ContentControl;
public class ContentControl : ContentControlBase
{
public static readonly DependencyProperty ContentCharacterCasingProperty =
DependencyProperty.Register("ContentCharacterCasing", typeof(CharacterCasing), typeof(ContentControl),
new FrameworkPropertyMetadata(CharacterCasing.Normal, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsMeasure),
value => CharacterCasing.Normal <= (CharacterCasing)value && (CharacterCasing)value <= CharacterCasing.Upper);
/// <summary>
/// Character casing of the Content
/// </summary>
public CharacterCasing ContentCharacterCasing
{
get { return (CharacterCasing)GetValue(ContentCharacterCasingProperty); }
set { SetValue(ContentCharacterCasingProperty, value); }
}
public static readonly DependencyProperty RecognizesAccessKeyProperty =
DependencyProperty.Register("RecognizesAccessKey", typeof(bool), typeof(ContentControl), new FrameworkPropertyMetadata(false));
/// <summary>
/// Determine if the inner ContentPresenter should use AccessText in its style
/// </summary>
public bool RecognizesAccessKey
{
get { return (bool)GetValue(RecognizesAccessKeyProperty); }
set { SetValue(RecognizesAccessKeyProperty, value); }
}
static ContentControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ContentControl), new FrameworkPropertyMetadata(typeof(ContentControl)));
}
}
}