Skip to content

Conversation

@mohamed-osman-se
Copy link

This PR removes empty RestoreBindings and ClearBindings methods from DependencyObjectStore.Binder
and adjusts the generated code in DependencyObjectGenerator.

Addresses #13046

@github-actions github-actions bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure labels Oct 2, 2025
@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
All committers have signed the CLA.

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21554/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 177648 has failed on Uno.UI - docs.

@unodevops
Copy link
Contributor

⚠️⚠️ The build 177649 has failed on Uno.UI - CI.

Copy link
Contributor

@Xiaoy312 Xiaoy312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you would need to update the last commit title to conform to conventional commits
ideally, you should rebase and squash them all into a single commit

@mohamed-osman-se mohamed-osman-se force-pushed the fix/remove-empty-bindings branch from ee62d5f to 8f0ab14 Compare October 4, 2025 18:43
@carldebilly carldebilly requested a review from Copilot October 4, 2025 18:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes empty RestoreBindings() and ClearBindings() methods that were previously kept for binary compatibility but contained no implementation. The changes clean up unused code by removing these obsolete methods from both the DependencyObjectStore.Binder class and the generated code in DependencyObjectGenerator.

Key changes:

  • Removed empty RestoreBindings() and ClearBindings() methods from DependencyObjectStore.Binder
  • Updated code generator to stop generating obsolete binding methods
  • Added package diff ignore entries for the removed methods to maintain compatibility tracking

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/DependencyObjectStore.Binder.cs Removed empty RestoreBindings() and ClearBindings() methods with their documentation
src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyObjectGenerator.cs Removed code generation for obsolete ClearBindings() and RestoreBindings() methods
src/Uno.UI/UI/Xaml/IFrameworkElementImplementation.UIKit.tt Removed call to ClearBindings() method
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyObjectGeneratorTests/Given_DependencyObjectGenerator.cs Updated test expectations to reflect removal of obsolete methods and cleaned up formatting
build/PackageDiffIgnore.xml Added ignore entries for removed methods to track API changes for version 6.2

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21554/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21554/docs/index.html

Comment on lines 2149 to 2150
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Removed in Uno 6.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.RestoreBindings()" reason="Removed in Uno 6.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a regex here, since the methods are code-generated on multiple classes

Suggested change
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Removed in Uno 6.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.RestoreBindings()" reason="Removed in Uno 6.2" />
<Member fullName="System\.Void .+\.(Clear|Restore)Bindings()" reason="Removed in Uno 6.2" />

<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.add_DataContextChanged(Windows.Foundation.TypedEventHandler`2&lt;Microsoft.UI.Xaml.FrameworkElement,Microsoft.UI.Xaml.DataContextChangedEventArgs&gt; value)" reason="Not present in WinAppSDK 1.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.remove_DataContextChanged(Windows.Foundation.TypedEventHandler`2&lt;Microsoft.UI.Xaml.FrameworkElement,Microsoft.UI.Xaml.DataContextChangedEventArgs&gt; value)" reason="Not present in WinAppSDK 1.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Not present in WinAppSDK 1.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid whitespace changes if possible

Suggested change
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Controls.ElementFactory.ClearBindings()" reason="Not present in WinAppSDK 1.2" />

remember to rebase squash after, otherwise it is still gonna stain the history

</IgnoreSet>
<IgnoreSet baseVersion="6.1">
<Types>
<Types>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Types>
<Types>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://dev.azure.com/uno-platform/Uno%20Platform/_build/results?buildId=177761&view=logs&j=f63c6d40-e6cc-5158-041c-5ecaeb969bfb&t=dd05ac6d-5f8e-575b-7053-261df9674ec3&s=1ca05b26-5479-52b6-b481-8cd3b39f1708
test arent passing
just remove only of Clear/ResumeBindings and their attributes/comments, and keep everything else the same, whitespace included

{

}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well, get rid of this extra empty line

Suggested change

@mohamed-osman-se mohamed-osman-se force-pushed the fix/remove-empty-bindings branch from 8f0ab14 to fad9620 Compare October 6, 2025 19:19
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21554/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21554/wasm-skia-net9/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants