Skip to content

FrameworkElement.GetBindingExpression is missing in 7.0 (WinUI parity) #24374

Closed

Description

@MartinZikmund

Current behavior 🐛

FrameworkElement.GetBindingExpression(DependencyProperty) is not available in Uno Platform 7.0.

Until 7.0, Uno exposed a public DependencyObject.GetBindingExpression(DependencyProperty). That member was Uno-only (WinUI declares GetBindingExpression on FrameworkElement, not on DependencyObject), and 1237cecff83 correctly demoted it to internal as part of narrowing the public surface for BC26.

However, Uno never implemented the WinUI-parity member either — src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml/FrameworkElement.cs:144 records it as:

// Forced skipping of method Microsoft.UI.Xaml.FrameworkElement.GetBindingExpression(Microsoft.UI.Xaml.DependencyProperty)

Net effect: 7.0 removed the Uno-only API without a parity replacement existing, so there is now no supported way for a library to read the BindingExpression of a bound property. This breaks shipped call sites in first-party libraries (Uno.Toolkit.UI, Uno.Extensions) with CS1061.

Expected behavior 🎯

FrameworkElement.GetBindingExpression(DependencyProperty) should exist and be public, matching WinUI.

WinUI declares it in the public IDL on FrameworkElement, right next to SetBinding:

// dxaml/xcp/dxaml/idl/winrt/core/microsoft.ui.xaml.coretypes.idl:2520
unsealed runtimeclass FrameworkElement
    ...
    void SetBinding(Microsoft.UI.Xaml.DependencyProperty dp, Microsoft.UI.Xaml.Data.BindingBase binding);
    Microsoft.UI.Xaml.Data.BindingExpression GetBindingExpression(Microsoft.UI.Xaml.DependencyProperty dp);

Implementation: dxaml/xcp/dxaml/lib/FrameworkElement_Partial.cpp:89,118. It reads the unevaluated local value and queries it for IBindingExpression, returning null rather than throwing when the property is not bound.

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

FrameworkElement sut = new ContentControl { Tag = 42d };
sut.SetBinding(FrameworkElement.WidthProperty, new Binding { Source = sut, Path = new PropertyPath("Tag") });

// Uno 7.0: CS1061 - 'FrameworkElement' does not contain a definition for 'GetBindingExpression'
// WinUI / Uno 6.x: returns the BindingExpression
var expression = sut.GetBindingExpression(FrameworkElement.WidthProperty);

Workaround 🛠️

None for external consumers. In-repo code and InternalsVisibleTo assemblies can still reach the internal DependencyObject.GetBindingExpression.

Affected platforms

All — this is a public API surface gap, not a renderer-specific issue.

Uno.UI version

7.0.0-dev.645

Activity

  1. added
    kind/bug
    on Sep 3, 2026
  2. self-assigned this
    on Sep 3, 2026
  3. added a commit that references this issue on Sep 5, 2026
    64617e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions