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

custom MarkupExtension are not supported XamlReader #14620

Open
Xiaoy312 opened this issue Nov 29, 2023 · 0 comments
Open

custom MarkupExtension are not supported XamlReader #14620

Xiaoy312 opened this issue Nov 29, 2023 · 0 comments
Labels
area/xaml-reader Categorizes an issue or PR as relevant to the XAML Reader difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/all Categorizes an issue or PR as relevant to the all platforms

Comments

@Xiaoy312
Copy link
Contributor

Xiaoy312 commented Nov 29, 2023

Current behavior

XamlReader.Load("""
	<Border xmlns... Background="{utu:ResponsiveExtension ...}" />
""");

attempting to parse custom MarkupExtension will result in this exception:

Object of type 'Uno.Toolkit.UI.ResponsiveExtension' cannot be converted to type 'Microsoft.UI.Xaml.Media.Brush'.

because we are simply not making custom handling rule for MarkupExtensions in XamlObjectBuilder‎::ProcessMemberElements
and assign it directly to the dependency property

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

class ResponsiveExtension : MarkupExtensions { }

XamlReader.Load("""
	<Border xmlns... Background="{local:ResponsiveExtension}" />
""");

Workaround

No response

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.WinUI@5.1.0-dev.486

Affected platforms

WebAssembly, Android, iOS, Skia (WPF)

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

You also must fully name the markup extension, can't skip the "-Extension" suffix

@Xiaoy312 Xiaoy312 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification area/xaml-reader Categorizes an issue or PR as relevant to the XAML Reader platform/all Categorizes an issue or PR as relevant to the all platforms difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Nov 29, 2023
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/xaml-reader Categorizes an issue or PR as relevant to the XAML Reader difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/all Categorizes an issue or PR as relevant to the all platforms
Projects
None yet
Development

No branches or pull requests

2 participants