Skip to content

Conversation

@stephenquan
Copy link

@stephenquan stephenquan commented Nov 3, 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!

Description of Change

Note

DISCLAIMER: This PR is for continued discussion only.

This PR is marked as experimental in the title of the PR. Reviewers please be are aware this should not be merged into a minor version or service release branch.

These changes include a breaking API change as IAttachedObject is being made public and VisualElement.Behaviors type is changing from IList<Behavior> to IList<IBehavior>.

Doing so will enable behaviors to be assigned to anything (including VisualElement).

Pull Request Overview (Generated by Copilot):
This PR introduces an experimental IBehavior interface in .NET MAUI to enable behaviors to be assigned to any object, not just those constrained by the concrete Behavior class. The change allows behaviors to inherit from VisualElement while implementing IBehavior, potentially enabling DynamicResource functionality through access to the ResourceDictionary.

Key Changes (Generated by Copilot):

  • Introduces public IBehavior and IBehavior<T> interfaces
  • Makes IAttachedObject interface public (previously internal)
  • Updates VisualElement.Behaviors property type from IList<Behavior> to IList<IBehavior>

Reviewed Changes (Generated by Copilot):

File Description
src/Controls/src/Core/VisualElement/VisualElement.cs Changed Behaviors property type from IList<Behavior> to IList<IBehavior>
src/Controls/src/Core/Interactivity/IBehavior.cs Added new IBehavior and IBehavior<T> interfaces
src/Controls/src/Core/Interactivity/IAttachedObject.cs Changed IAttachedObject visibility from internal to public
src/Controls/src/Core/Interactivity/Behavior.cs Updated Behavior and Behavior<T> to implement IBehavior and IBehavior<T> respectively
src/Controls/src/Core/PublicAPI/*/PublicAPI.Shipped.txt Updated public API surface to reflect new interfaces and changed signatures

Issues Fixed

Fixes #

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 3, 2025
@dotnet-policy-service
Copy link
Contributor

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

@stephenquan stephenquan marked this pull request as ready for review November 3, 2025 08:38
Copilot AI review requested due to automatic review settings November 3, 2025 08:38
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 introduces an experimental IBehavior interface in .NET MAUI to enable behaviors to be assigned to any object, not just those constrained by the concrete Behavior class. The change allows behaviors to inherit from VisualElement while implementing IBehavior, potentially enabling DynamicResource functionality through access to the ResourceDictionary.

Key Changes:

  • Introduces public IBehavior and IBehavior<T> interfaces
  • Makes IAttachedObject interface public (previously internal)
  • Updates VisualElement.Behaviors property type from IList<Behavior> to IList<IBehavior>

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Controls/src/Core/VisualElement/VisualElement.cs Changed Behaviors property type from IList<Behavior> to IList<IBehavior>
src/Controls/src/Core/Interactivity/IBehavior.cs Added new IBehavior and IBehavior<T> interfaces
src/Controls/src/Core/Interactivity/IAttachedObject.cs Changed IAttachedObject visibility from internal to public
src/Controls/src/Core/Interactivity/Behavior.cs Updated Behavior and Behavior<T> to implement IBehavior and IBehavior<T> respectively
src/Controls/src/Core/PublicAPI/*/PublicAPI.Shipped.txt Updated public API surface to reflect new interfaces and changed signatures

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

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

Labels

area-xaml XAML, CSS, Triggers, Behaviors community ✨ Community Contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants