-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Documentation for IElementHandler * apply cr suggestions --------- Co-authored-by: Diana Soltani <dianasoltani@microsoft.com>
- Loading branch information
1 parent
d22cb6a
commit 86b71e1
Showing
1 changed file
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,54 @@ | ||
namespace Microsoft.Maui | ||
{ | ||
/// <summary> | ||
/// Defines the core behavior necessary to create a custom element handler. | ||
/// <seealso href="https://learn.microsoft.com/dotnet/maui/user-interface/handlers/"> Conceptual documentation on handlers</seealso> | ||
/// </summary> | ||
public interface IElementHandler | ||
{ | ||
/// <summary> | ||
/// Sets the .NET MAUI context for the element handler. | ||
/// </summary> | ||
/// <param name="mauiContext">The .NET MAUI context to set.</param> | ||
void SetMauiContext(IMauiContext mauiContext); | ||
|
||
|
||
/// <summary> | ||
/// Sets the cross-platform virtual view associated with the handler. | ||
/// </summary> | ||
/// <param name="view">The element to handle.</param> | ||
void SetVirtualView(IElement view); | ||
|
||
/// <summary> | ||
/// Updates the value of the specified property on the handler. | ||
/// </summary> | ||
/// <param name="property">The name of the property to update.</param> | ||
void UpdateValue(string property); | ||
|
||
/// <summary> | ||
/// Invokes the specified command on the element with the given arguments. | ||
/// </summary> | ||
/// <param name="command">The name of the command to invoke.</param> | ||
/// <param name="args">Optional arguments to pass to the command.</param> | ||
void Invoke(string command, object? args = null); | ||
|
||
/// <summary> | ||
/// Disconnects the element handler from the element for clean up. | ||
/// </summary> | ||
void DisconnectHandler(); | ||
|
||
/// <summary> | ||
/// Gets the platform-specific view object associated with the handler. | ||
/// </summary> | ||
object? PlatformView { get; } | ||
|
||
/// <summary> | ||
/// Gets the cross-platform virtual view associated with the handler. | ||
/// </summary> | ||
IElement? VirtualView { get; } | ||
|
||
/// <summary> | ||
/// Gets the .NET MAUI context associated with the element. | ||
/// </summary> | ||
IMauiContext? MauiContext { get; } | ||
} | ||
} |