[Docs] Update DynamicBindExtension Code in 5.4 Blog Post and Documentation #18493
Labels
difficulty/tbd
Categorizes an issue for which the difficulty level needs to be defined.
kind/documentation
triage/untriaged
Indicates an issue requires triaging or verification
On which pages?
What's wrong?
As per discussions with @Xiaoy312 and @jeromelaban, we need to update the
DynamicBindExtension
example code in the 5.4 blog post and related documentation to align with current WinUI specifications. The current implementation needs adjustments to avoid compilation errors.Current Behavior:
The current example shows the following implementation, which results in XAML compilation errors:
Errors Encountered:
WinUI throws the following error:
XamlCompiler error WMC0100: XAML DynamicBindExtension type cannot be constructed.
Additionally, if the default constructor issue is resolved, WinUI will still raise:
XamlCompiler error WMC0615: Type 'local' used after '{' must be a Markup Extension. Error code 0x09d7.
This is because positional arguments (as in
{local:DynamicBind Tag}
) are not supported.Proposed Solution:
The code should be updated to the following implementation to support property-based binding:
Updated C# Code:
Updated XAML Usage:
<TextBlock Text="{local:DynamicBind PropertyName=Tag}" />
Next Steps:
The 5.4 blog post example will need to be also updated accordingly. (cc @mtmattei for info)
References:
The text was updated successfully, but these errors were encountered: