Files
Shrlalgo.RvKits/AntDesignWPF/Controls/AntdContentControl.cs

40 lines
1.7 KiB
C#
Raw Normal View History

2025-07-31 20:12:01 +08:00
namespace AntDesign.WPF.Controls
2025-07-11 09:20:23 +08:00
{
using System.Windows;
using System.Windows.Controls;
2025-07-12 23:31:32 +08:00
public class AntdContentControl : ContentControl
2025-07-11 09:20:23 +08:00
{
public static readonly DependencyProperty ContentCharacterCasingProperty =
2025-07-12 23:31:32 +08:00
DependencyProperty.Register("ContentCharacterCasing", typeof(CharacterCasing), typeof(AntdContentControl),
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>
/// Character casing of the Content
/// </summary>
public CharacterCasing ContentCharacterCasing
{
get { return (CharacterCasing)GetValue(ContentCharacterCasingProperty); }
set { SetValue(ContentCharacterCasingProperty, value); }
}
public static readonly DependencyProperty RecognizesAccessKeyProperty =
2025-07-12 23:31:32 +08:00
DependencyProperty.Register("RecognizesAccessKey", typeof(bool), typeof(AntdContentControl), new FrameworkPropertyMetadata(false));
2025-07-11 09:20:23 +08:00
/// <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); }
}
2025-07-12 23:31:32 +08:00
static AntdContentControl()
2025-07-11 09:20:23 +08:00
{
2025-07-12 23:31:32 +08:00
DefaultStyleKeyProperty.OverrideMetadata(typeof(AntdContentControl), new FrameworkPropertyMetadata(typeof(AntdContentControl)));
2025-07-11 09:20:23 +08:00
}
}
}