Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

SimpleValueTargetProvider does not expose ParentObjects property. #5052

Closed
jamiewest opened this issue Jan 24, 2019 · 3 comments
Closed

SimpleValueTargetProvider does not expose ParentObjects property. #5052

jamiewest opened this issue Jan 24, 2019 · 3 comments
Assignees

Comments

@jamiewest
Copy link

I am following along with the Creating XAML Markup Extensions docs and in the Service Providers section it mentions the SimpleValueTargetProvider.ParentObjects property. This property is not accessible because the IProvideParentValues interface that SimpleValueTargetProvider inherits is internal.

For some reason VS2017 intellisense exposes the property during debugging but it wont let you code with it. This ParentObects property would be super helpful. How can I access this?

@StephaneDelcroix
Copy link
Member

You shouldn't use SimpleValueTargetProvider and expect that type to be returned whenever you request an IProvideValueTarget. The serviceProvider returned can depend on the context, and wether or not XamlC is enabled.

The point of ParentObjects is to implement IReferenceProvider, you might find what you need over there. We do not have plans to open ParentObjects as generating it is quite expensive, and we're still trying to see if we can avoid producing it.

hope it helps

Triage automation moved this from New to Closed Jan 24, 2019
@jamiewest
Copy link
Author

The docs should be updated to not reference this then.

I reviewed ‘IReferenceProvider’ and this won’t help me. I need to be able to identify the parent hierarchy of a ‘TargetObject’ from within an ‘IMarkupExtension’. I need access to all the types so I can search for the one I want based on the type’e inheritance, not the name. Any ideas?

@dansiegel
Copy link
Contributor

@StephaneDelcroix I'd have to concur I have some scenarios as well where I need to evaluate the parent objects... it would really be great to open this API up

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants