Open michael-hawker opened 3 years ago
So, when I try this, IntelliSense tells me that the DefaultTokenizingTextBoxStyle
is not found. It compiles fine, but I get a Xaml error at runtime during app startup.
Thanks for taking a look @alvinashcraft so seems like we may be missing something to expose these. I wonder if this works differently in UWP and that's why WinUI forces the add to App.xaml?
@ranjeshj do you know who we'd talk to about how this system works and if this is expected or not?
I wonder if this works differently in UWP and that's why WinUI forces the add to App.xaml?
I'm pretty sure this is correct, I vaguely remember someone from the WinUI team mentioning this limitation. Might have been an early community call or something.
Are there any updates on this investigation? Is the WCT going to do the same as WinUI?
I think this is a platform limitation and related to this issue here maybe? https://github.com/microsoft/microsoft-ui-xaml/issues/3502
Accessing named resources defined in Themes\Generic.xaml
doesn't even work from within the same project, so it seems like an intentional design choice that the resources in there aren't added to the application's resources by default.
@sylveon Is 100% correct, this seems to be by design. Styles inside Themes\Generic.xaml files will be used to lookup the default style, however resource wise, you can't access them. Only way to access them is by manually adding them to the resources dictionary (e.g. through merged dictionaries). This is also what WinUI does. Not that manually referencing the resources will also override existing resource if they have also been defined in the WCT (as is the case with a few resources).
See start of discussion on this thread here: https://github.com/windows-toolkit/WindowsCommunityToolkit/pull/3556#issuecomment-726656619
Describe the bug
When a developer uses the Toolkit they should have access to the style/resources we expose in order to use them as a basis for modifications. On the discussion above, it's unclear if that's happening properly or not...
Steps to Reproduce
Steps to reproduce the behavior:
<Page.Resources>
and try and create a new style based on aDefaultTokenizingTextBoxStyle
Expected behavior
It should work...
Related to #3602