Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm: exception loading ResourceDictionary from string #640

Closed
yowl opened this issue Mar 1, 2019 · 1 comment

Comments

@yowl
Copy link

commented Mar 1, 2019

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Attempting the following code in wasm:

XamlReader.Load(@"<ResourceDictionary
    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" 
    xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
    
    <Style TargetType=""TextBlock"" x:Key=""DefaultColumnStyle"">
    </Style>    
</ResourceDictionary>
");

Results in an exception as it appears to be looking for the type on the ResourceDictionary itself and not the inner Style:

System.InvalidOperationException: Implicit content is not supported on {http://schemas.microsoft.com/winfx/2006/xaml/presentation}ResourceDictionary
mono.js:1   at Windows.UI.Xaml.Markup.Reader.XamlObjectBuilder.GetMemberProperty (Windows.UI.Xaml.Markup.Reader.XamlObjectDefinition control, Windows.UI.Xaml.Markup.Reader.XamlMemberDefinition member) <0x38b0f88 + 0x000a4> in <5657f6387daa4318abd059dc46b216ac>:0 
mono.js:1   at Windows.UI.Xaml.Markup.Reader.XamlObjectBuilder.ProcessNamedMember (Windows.UI.Xaml.Markup.Reader.XamlObjectDefinition control, System.Object instance, Windows.UI.Xaml.Markup.Reader.XamlMemberDefinition member) <0x38a8a80 + 0x00126> in <5657f6387daa4318abd059dc46b216ac>:0 
mono.js:1   at Windows.UI.Xaml.Markup.Reader.XamlObjectBuilder.LoadObject (Windows.UI.Xaml.Markup.Reader.XamlObjectDefinition control) <0x3889498 + 0x001c4> in <5657f6387daa4318abd059dc46b216ac>:0 
mono.js:1   at Windows.UI.Xaml.Markup.Reader.XamlObjectBuilder.Build () <0x38803f0 + 0x0002a> in <5657f6387daa4318abd059dc46b216ac>:0 
mono.js:1   at Windows.UI.Xaml.Markup.XamlReader.Load (System.String xaml) <0x36ff0c8 + 0x0002e> in <5657f6387daa4318abd059dc46b216ac>:0 
mono.js:1   at UnoStandardRefTest.MainPage..ctor () <0x36fe608 + 0x00022> in <709e7433be0849a99e576b956664c5a9>:0 

Repo at https://github.com/yowl/UnoStandardRefTest/tree/loadrd

Expected behavior

wasm should be able to load ResourceDictionary from a string as this will help with the support of third party controls like Telerik.

Minimal reproduction of the problem with instructions

As above

Environment

Nuget Package: Uno.UI 1.43.0-dev.925

Package Version(s): 

Affected platform(s):
- [ ] iOS
- [ ] Android
- [x ] WebAssembly
- [ ] Windows
- [ ] Build tasks

Visual Studio
- [ x] 2017 (version: )
- [ ] 2017 Preview (version: )
- [ ] for Mac (version: )

Relevant plugins
- [ ] Resharper (version: )
@jeromelaban jeromelaban added the kind/bug label Mar 6, 2019
@yowl

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

rdpatch.txt
This is the quick patch a made to work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.