Adding Resource doesn't work in WinUI 3 for desktop
See original GitHub issueWhen adding a xaml resource the project doesn’t compile
<Grid.Resources>
<local:MyClass x:Key="asdf"/>
</Grid.Resources>
Error WMC0026 Cannot add ‘MyClass’ into the dictionary property ‘Resources’, type must be ‘Object’ C:\Projects\XXXXXX\MainWindow.xaml 48
Additionally the Window object has no Resource property.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:15 (11 by maintainers)
Top Results From Across the Web
How do I access Window Resources in WinUI 3
I've just started working on a WinUi 3 (Desktop) project and have got blocked trying to add Window resources to a Window.
Read more >Application.Resources Property (Windows.UI.Xaml)
This example shows how to declare an app-specific resource (this one creates a common converter class instance that comes from starting templates).
Read more >Building Modern Desktop Apps—Is WinUI 3.0 the Way to Go?
WinUI 3.0 is the hot new framework for desktop application development. In this post we'll try to answer the questions “What is WinUI...
Read more >Build Cross-Platform apps with WinUI and Uno Platform
With Uno Platform you can bring your WinUI apps everywhere that WinUI does not natively run– Web/WebAssembly, Linux, macOS, iOS, and Android.
Read more >Modernizing Your Windows Applications with the Windows App ...
Expand your desktop apps to support new features and deliver an ... You will find a template called Resource Dictionary (WinUI 3) –...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think it needs to be DependencyObject in order to be placed in the resource dictionary. If it takes object, that should just work. Perhaps the markup compiler is getting tripped by something. @stevenbrix @alwu-msft any ideas ?
Marking as closed since this should be resolved in the
0.5-prerelease
version of Project Reunion.