DataTemplateSelector implementation not finding any resource on FindNodeResource.
Posted: 26 Jan 2026, 10:39
Hello,
I have an implementation of a DataTemplateSelector that seems to be strugling to find the resource even if it exist using FindNodeResource.
However I have found that if I use Noesis::GUI::GetApplicationResource, it works. it seems that my dataTemplateSelector doesn't have access to the correct context for resource.
I tried to create that dataTemplate selector in various places (in my global dictionary, locally in the current page's Resource or in place directly in the ContentControl.ContentTemplateSelector.
Is this something I am doing wrong or is Noesis::GUI::GetApplicationResource() is to be used in my case? (I also have tried with the second parameter being true if that makes a difference)
(EDIT: I created this in the wrong channel, it should be General discussion. can we move it there? Sorry about that.)
Thank you!
I have an implementation of a DataTemplateSelector that seems to be strugling to find the resource even if it exist using FindNodeResource.
However I have found that if I use Noesis::GUI::GetApplicationResource, it works. it seems that my dataTemplateSelector doesn't have access to the correct context for resource.
Code: Select all
// Not working in DataTemplateSelector
BaseComponent* resourceCannotBeFound = FindNodeResource(ResourceToFind.Str(), false);
// Working
BaseComponent* ResourceFoundProperly = Noesis::GUI::GetApplicationResources()->FindNodeResource(ResourceToFind.Str(), false);
Is this something I am doing wrong or is Noesis::GUI::GetApplicationResource() is to be used in my case? (I also have tried with the second parameter being true if that makes a difference)
(EDIT: I created this in the wrong channel, it should be General discussion. can we move it there? Sorry about that.)
Thank you!