Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2150
XamPropertyGrid and UI Automation
posted

I'm seeing leaks and performance problems related to UI automation (accessibility) in the XamPropertyGrid.

Is there an easy or secret way to disable this feature?  I'd rather not deal with unintended consequences of an unintentional feature.  In general I'm not against the concept of accessibility, but we aren't ready for supporting it if there is an added cost (and if it introduces bugs).

Currently the only way I've found is to create a new control that derives directly from XamPropertyGrid and override OnCreateAutomationPeer to return null.  This seems like the long way around, and I have to believe there is another approach to accomplishing the same thing.  Any help would be appreciated.

Parents
  • 34810
    Verified Answer
    Offline posted

    Hello David,

    Thank you for your post on this matter. I am under the impression that this forum thread is coming from another one that we have together, linked here.

    https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/119776/xampropertygrid-is-instantly-rooted

    The short answer to this, is that there is no easy or “secret” property to prevent UI Automation peers from being created that I personally know of except for the override of OnCreateAutomationPeer that you have already mentioned. This is a result of the XamPropertyGrid having support for UI Automation, and is a completely intentional feature.

    In the other thread, linked above, you had mentioned that you did this, and are seeing issues apparently with other automation peers – the ScrollBarAutomationPeer. This is created for the built-in WPF ScrollBar that the XamPropertyGrid uses for vertical scrolling, and we have no control over this. Something you could potentially do in that case is to include the default template for the XamPropertyGrid that can be retrieved from the generic.shared.xaml file commonly found at the directory below, and replace it with a custom ScrollBar that overrides OnCreateAutomationPeer to do what is being done with the XamPropertyGrid. This is not ideal, but it is the only way I personally know to completely disable UI Automation of elements in WPF.

    C:\Program Files (x86)\Infragistics\<your version here> \WPF\DefaultStyles\PropertyGrid\generic.shared.xaml

    Please let me know if you have any other questions or concerns on this matter.

Reply Children