You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ResourceDictionary x KeyValuePair convert code generation #14025
area/code-generationCategorizes an issue or PR as relevant to code generationdifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't working
Works fine on UWP, but in other platforms (even WinUI) I'm getting a code generation error when trying to use a <ResourceDictionary> in a Dependency Property:
>C:\UnoPlatform\Uno.Themes\src\samples\UWP\Uno.Themes.Samples.Skia.Gtk\Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator\ButtonSamplePage_ffaf46608a7221259020a046294eeefc.cs(133,37,149,11): error CS1503: Argument 1: cannot convert from 'Windows.UI.Xaml.ResourceDictionary' to 'System.Collections.Generic.KeyValuePair<object, object>'
DP
public static DependencyProperty ColorPaletteProperty { [DynamicDependency(nameof(GetColorPalette))] get; } = DependencyProperty.RegisterAttached(
"ColorPalette",
typeof(ResourceDictionary),
typeof(ThemeExtensions),
new PropertyMetadata(default, OnColorPaletteChanged));
Works fine on UWP, but in other platforms (even WinUI) I'm getting a code generation
@jeromelaban From the description it seems it's supported in UWP but not WinUI. We can't control what happens on WinUI anyway. So do we need to do anything here at all?
I mean, you get the same error in a Uno App running on Windows (WinUI), the error is still in Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator ...
changed the title [-]ResourceDictionary x KeyValuePair convert code generation [/-][+]`ResourceDictionary` x `KeyValuePair` convert code generation [/+]on Oct 25, 2023
If it's not supported by WinUI, we can close. @eriklimakc @kazo0 do we need to track something here in toolkit for the scenario you were trying to reach?
area/code-generationCategorizes an issue or PR as relevant to code generationdifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't working
Activity
Youssef1313 commentedon Oct 19, 2023
@jeromelaban From the description it seems it's supported in UWP but not WinUI. We can't control what happens on WinUI anyway. So do we need to do anything here at all?
cc @kazo0
erikvilima commentedon Oct 19, 2023
I mean, you get the same error in a Uno App running on Windows (WinUI), the error is still in
Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator ...But you are able to do that in a WinUI App like:
WinUI.zip
cc @Youssef1313
Youssef1313 commentedon Oct 19, 2023
Then the error isn't really for WinUI. The Windows project doesn't use XamlCodeGenerator at all (it's all Microsoft things).
[-]ResourceDictionary x KeyValuePair convert code generation [/-][+]`ResourceDictionary` x `KeyValuePair` convert code generation [/+]jeromelaban commentedon Oct 26, 2023
If it's not supported by WinUI, we can close. @eriklimakc @kazo0 do we need to track something here in toolkit for the scenario you were trying to reach?
Youssef1313 commentedon Oct 26, 2023
@jeromelaban I confirmed it's supported by WinUI. I think #14040 should be ready to merge (except for a runtime test that I forgot to add)