File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/Controls/src/Core/Interactivity Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 11#nullable disable
22namespace Microsoft . Maui . Controls
33{
4+
5+ /// <summary>
6+ /// Defines a contract for objects that can be attached to a <see cref="BindableObject"/>.
7+ /// This interface is typically implemented by behaviors or effects that need to interact with
8+ /// the lifecycle or properties of a visual element in the UI.
9+ /// </summary>
410 public interface IAttachedObject
511 {
12+
13+ /// <summary>
14+ /// Attaches the object to the specified <see cref="BindableObject"/>.
15+ /// This method is called when the object is added to the visual tree.
16+ /// </summary>
17+ /// <param name="bindable">The <see cref="BindableObject"/> to attach to.</param>
618 void AttachTo ( BindableObject bindable ) ;
19+
20+ /// <summary>
21+ /// Detaches the object from the specified <see cref="BindableObject"/>.
22+ /// This method is called when the object is removed from the visual tree.
23+ /// </summary>
24+ /// <param name="bindable">The <see cref="BindableObject"/> to detach from.</param>
725 void DetachFrom ( BindableObject bindable ) ;
826 }
927}
Original file line number Diff line number Diff line change 33
44namespace Microsoft . Maui . Controls
55{
6+
7+ /// <summary>
8+ /// Represents a behavior that can be attached to a <see cref="BindableObject"/>.
9+ /// </summary>
610 public interface IBehavior : INotifyPropertyChanged , IAttachedObject
711 {
812 }
913
14+ /// <summary>
15+ /// Represents a behavior that can be attached to a specific type of <see cref="BindableObject"/>.
16+ /// This generic interface allows behaviors to be strongly typed to the target element.
17+ /// </summary>
18+ /// <typeparam name="T">The type of <see cref="BindableObject"/> the behavior can attach to.</typeparam>
1019 public interface IBehavior < T > : IBehavior where T : BindableObject
1120 {
1221 }
You can’t perform that action at this time.
0 commit comments