Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Controls/src/Core/INativeBindingService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#nullable disable
using System;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.Maui.Controls.Xaml.Internals
{

[Obsolete("INativeBindingService is obsolete and will be removed in a future release.")]
public interface INativeBindingService
{
[RequiresUnreferencedCode(TrimmerConstants.StringPathBindingWarning, Url = TrimmerConstants.ExpressionBasedBindingsDocsUrl)]
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/src/Xaml/ApplyPropertiesVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ static bool TrySetBinding(object element, BindableProperty property, string loca
if (exception != null)
return false;

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

Comment on lines +551 to 554
Copy link

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.
if (binding == null)
return false;
Expand Down Expand Up @@ -576,7 +578,9 @@ static bool TrySetValue(object element, BindableProperty property, bool attached
exception = null;

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

if (property == null)
return false;
Expand Down
Loading