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

Handle cases where Binding markup extension is treated as "regular" property value #18345

Open
Youssef1313 opened this issue Oct 1, 2024 · 0 comments · May be fixed by #18346
Open

Handle cases where Binding markup extension is treated as "regular" property value #18345

Youssef1313 opened this issue Oct 1, 2024 · 0 comments · May be fixed by #18346
Assignees
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine triage/untriaged Indicates an issue requires triaging or verification

Comments

@Youssef1313
Copy link
Member

Youssef1313 commented Oct 1, 2024

This is related to https://github.com/unoplatform/kahua-private/issues/205

Current behavior

<Page x:Class="UnoApp10.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:UnoApp10"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
  <StackPanel>
    <local:MyCustomPanel x:Name="SUT" MyBinding="{Binding Hello2}"></local:MyCustomPanel>
  </StackPanel>
</Page>
using Microsoft.UI.Xaml.Data;

namespace UnoApp10;

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
    }
}

public partial class MyCustomPanel : Panel
{
    private BindingBase _myBinding;

    public BindingBase MyBinding { get => _myBinding; set => _myBinding = value; /* add breakpoint here */ }
}

On WinUI, this should set the binding as "regular" property, which is not the case in Uno.

IMPORTANT NOTES:

  1. If the MyBinding property was a DP, then the binding markup extension will be treated regularly as a binding, not property value.
  2. MyBinding being a DP is not simply that there is a static MyBindingProperty, the registration name must match the C# property name. So, something like DependencyProperty.Register("_MyBinding", ...) will not consider MyBinding as a DP, hence it will be regular property value.

Expected behavior

Match WinUI

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

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@Youssef1313 Youssef1313 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Oct 1, 2024
@Youssef1313 Youssef1313 self-assigned this Oct 1, 2024
@Youssef1313 Youssef1313 added the project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine label Oct 1, 2024
@Youssef1313 Youssef1313 linked a pull request Oct 1, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working project/binding 🪢 Categorizes an issue or PR as relevant to the binding engine triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant