-
Notifications
You must be signed in to change notification settings - Fork 67
Add basic support for automation #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ec30c1f
405ccfd
46b2a73
4f385ef
ab017b3
aeb36a9
5f63dc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Avalonia.Automation.Peers; | ||
|
||
namespace Avalonia.Controls.Automation.Peers; | ||
|
||
public class TreeDataGridAutomationPeer : ControlAutomationPeer | ||
{ | ||
public TreeDataGridAutomationPeer(TreeDataGrid owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
public new TreeDataGrid Owner => (TreeDataGrid)base.Owner; | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.DataGrid; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Avalonia.Automation.Peers; | ||
using Avalonia.Controls.Primitives; | ||
|
||
namespace Avalonia.Controls.Automation.Peers; | ||
|
||
public class TreeDataGridCellAutomationPeer : ControlAutomationPeer | ||
{ | ||
public TreeDataGridCellAutomationPeer(TreeDataGridCell owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
public new TreeDataGridCell Owner => (TreeDataGridCell)base.Owner; | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Custom; | ||
} | ||
|
||
protected override bool IsContentElementCore() => true; | ||
|
||
protected override bool IsControlElementCore() => true; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Avalonia.Automation.Peers; | ||
using Avalonia.Controls.Primitives; | ||
|
||
namespace Avalonia.Controls.Automation.Peers; | ||
|
||
public class TreeDataGridColumnHeaderAutomationPeer : ContentControlAutomationPeer | ||
{ | ||
public TreeDataGridColumnHeaderAutomationPeer(TreeDataGridColumnHeader owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
public new TreeDataGridColumnHeader Owner => (TreeDataGridColumnHeader)base.Owner; | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.HeaderItem; | ||
} | ||
|
||
protected override bool IsContentElementCore() => false; | ||
|
||
protected override bool IsControlElementCore() => true; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Avalonia.Automation.Peers; | ||
using Avalonia.Controls.Primitives; | ||
|
||
namespace Avalonia.Controls.Automation.Peers; | ||
|
||
public class TreeDataGridColumnHeadersPresenterAutomationPeer : ControlAutomationPeer | ||
{ | ||
public TreeDataGridColumnHeadersPresenterAutomationPeer(TreeDataGridColumnHeadersPresenter owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
public new TreeDataGridColumnHeadersPresenter Owner => (TreeDataGridColumnHeadersPresenter)base.Owner; | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Header; | ||
} | ||
|
||
protected override bool IsContentElementCore() => false; | ||
|
||
protected override bool IsControlElementCore() => true; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Avalonia.Automation.Peers; | ||
using Avalonia.Controls.Primitives; | ||
|
||
namespace Avalonia.Controls.Automation.Peers; | ||
|
||
public class TreeDataGridRowAutomationPeer : ControlAutomationPeer | ||
{ | ||
public TreeDataGridRowAutomationPeer(TreeDataGridRow owner) | ||
: base(owner) | ||
{ | ||
} | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.DataItem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be TreeItem, I think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Row itself should also implement IValueProvider There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And possible IToggleProvider (since it can be expanded/collapsed) |
||
} | ||
|
||
protected override bool IsContentElementCore() => true; | ||
|
||
protected override bool IsControlElementCore() => true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't cell be a content control automation peer? Or just override GetNameCore
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Automation/Peers/ContentControlAutomationPeer.cs#L16-L31