File tree Expand file tree Collapse file tree
dev/DevWinUI.Controls/Controls/Ported/SettingsCard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ namespace DevWinUI;
1010/// <summary>
1111/// AutomationPeer for SettingsCard
1212/// </summary>
13- public partial class SettingsCardAutomationPeer : FrameworkElementAutomationPeer
13+ public partial class SettingsCardAutomationPeer : ButtonBaseAutomationPeer
1414{
1515 /// <summary>
1616 /// Initializes a new instance of the <see cref="SettingsCard"/> class.
@@ -68,4 +68,23 @@ protected override string GetNameCore()
6868
6969 return base . GetNameCore ( ) ;
7070 }
71+
72+ protected override object ? GetPatternCore ( PatternInterface patternInterface )
73+ {
74+ if ( patternInterface == PatternInterface . Invoke )
75+ {
76+ if ( Owner is SettingsCard settingsCard && settingsCard . IsClickEnabled )
77+ {
78+ // Only provide Invoke pattern if the card is clickable
79+ return this ;
80+ }
81+ else
82+ {
83+ // Not clickable, do not provide Invoke pattern
84+ return null ;
85+ }
86+ }
87+
88+ return base . GetPatternCore ( patternInterface ) ;
89+ }
7190}
You can’t perform that action at this time.
0 commit comments