mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-27 11:43:24 +08:00
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
namespace Fluent.Automation.Peers
|
|
{
|
|
using System.Windows;
|
|
using System.Windows.Automation.Peers;
|
|
using JetBrains.Annotations;
|
|
|
|
/// <summary>
|
|
/// Base automation peer for <see cref="IHeaderedControl"/>.
|
|
/// </summary>
|
|
public abstract class RibbonHeaderedControlAutomationPeer : FrameworkElementAutomationPeer
|
|
{
|
|
/// <summary>
|
|
/// Creates a new instance.
|
|
/// </summary>
|
|
protected RibbonHeaderedControlAutomationPeer([NotNull] FrameworkElement owner)
|
|
: base(owner)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override string GetClassNameCore()
|
|
{
|
|
return this.Owner.GetType().Name;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override string GetNameCore()
|
|
{
|
|
var name = base.GetNameCore();
|
|
|
|
if (string.IsNullOrEmpty(name))
|
|
{
|
|
name = (this.Owner as IHeaderedControl)?.Header as string;
|
|
}
|
|
|
|
return name;
|
|
}
|
|
}
|
|
} |