CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Bug: NullReferenceException in generated resource code

Open dotMorten opened this issue 1 year ago • 0 comments

Description

I have a custom resource dictionary for my generic xaml, with code-behind so I can use x-bind in my control templates. However when using converters a null-reference exception is thrown in the generated code because the localResources field hasn't been initialized.

Image

Steps To Reproduce

  1. Unpack, open and run the following sample: XBindBug.zip
  2. Note the above exception.

Expected Behavior

No exception ;-)

Version Info

CSWinRT 2.2.0, WinAppSDK 1.7.0

Additional Context

If I move all code-behind to generic.xaml this issue does go away, but I don't want all my control styles in a single file for maintainability. This appears to just be a code generator bug.

dotMorten avatar Mar 25 '25 23:03 dotMorten