Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Controls;
/// <summary>
/// AutomationPeer for SettingsCard
/// </summary>
public partial class SettingsCardAutomationPeer : FrameworkElementAutomationPeer
public partial class SettingsCardAutomationPeer : ButtonBaseAutomationPeer
{
/// <summary>
/// Initializes a new instance of the <see cref="SettingsCard"/> class.
Expand Down Expand Up @@ -66,4 +66,24 @@ protected override string GetNameCore()

return base.GetNameCore();
}

/// <inheritdoc/>
protected override object? GetPatternCore(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.Invoke)
{
if (Owner is SettingsCard settingsCard && settingsCard.IsClickEnabled)
{
// Only provide Invoke pattern if the card is clickable
return this;
}
else
{
// Not clickable, do not provide Invoke pattern
return null;
}
}

return base.GetPatternCore(patternInterface);
}
}
Loading