Skip to content

[NET10] Marked INativeBindingService as Obsolete #29918

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

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jun 10, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issues Fixed

Fixes #21861

@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 23:18
@kubaflo kubaflo requested a review from a team as a code owner June 10, 2025 23:18
@kubaflo kubaflo requested review from PureWeen and tj-devel709 June 10, 2025 23:18
@kubaflo kubaflo self-assigned this Jun 10, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jun 10, 2025
Copy link
Contributor

Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copy link
Contributor

@Copilot 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 marks the INativeBindingService interface as obsolete and suppresses the resulting compiler warnings at its call sites in ApplyPropertiesVisitor.

  • Added [Obsolete] attribute to INativeBindingService in Core.
  • Introduced #pragma warning disable/restore CS0618 around two usages in ApplyPropertiesVisitor.
  • Added using System; for the Obsolete attribute.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Controls/src/Core/INativeBindingService.cs Mark INativeBindingService as obsolete and import System.
src/Controls/src/Xaml/ApplyPropertiesVisitor.cs Suppress CS0618 warnings around DependencyService.Get<INativeBindingService>().
Comments suppressed due to low confidence (1)

src/Controls/src/Core/INativeBindingService.cs:8

  • Please update the public XML documentation in /docs/ to mention that INativeBindingService is now obsolete and will be removed in a future release, so consumers see this deprecation in the official docs.
[Obsolete("INativeBindingService is obsolete and will be removed in a future release.")]

Comment on lines +551 to 554
#pragma warning disable CS0618 // Type or member is obsolete
var nativeBindingService = DependencyService.Get<INativeBindingService>();
#pragma warning restore CS0618 // Type or member is obsolete

Copy link
Preview

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

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

[nitpick] This pragma silences warnings for the now-obsolete INativeBindingService. Consider refactoring to the new binding API or removing these calls before the interface is removed in a future release.

Suggested change
#pragma warning disable CS0618 // Type or member is obsolete
var nativeBindingService = DependencyService.Get<INativeBindingService>();
#pragma warning restore CS0618 // Type or member is obsolete

Copilot uses AI. Check for mistakes.

@kubaflo kubaflo changed the title [NET10} Marked INativeBindingService as Obsolete [NET10] Marked INativeBindingService as Obsolete Jun 10, 2025
@PureWeen PureWeen added this to the .NET 10.0-preview6 milestone Jun 10, 2025
@PureWeen PureWeen added the p/0 Work that we can't release without label Jun 10, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Jun 10, 2025
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

@StephaneDelcroix Thoughts?

@StephaneDelcroix
Copy link
Contributor

that capability was lost during the transition from XF to maui, and we didn't get much complain. I'm sure we'll reinvent it later, but let's obsolete and eventually remove

@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jun 12, 2025
@PureWeen PureWeen merged commit 5f1e464 into dotnet:net10.0 Jun 12, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution p/0 Work that we can't release without
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants