Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 0ad5dff

Browse files
jfversluispictos
authored andcommitted
Added inline docs (#882)
1 parent 15b1be7 commit 0ad5dff

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/MaxLengthReachedBehavior.shared.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,35 @@
77

88
namespace Xamarin.CommunityToolkit.Behaviors
99
{
10+
/// <summary>
11+
/// The <see cref="MaxLengthReachedBehavior"/> is a behavior that allows the user to trigger an action when a user has reached the maximum length allowed on an <see cref="InputView"/>. It can either trigger a <see cref="ICommand"/> or an event depending on the user's preferred scenario.
12+
/// </summary>
1013
public class MaxLengthReachedBehavior : BaseBehavior<InputView>
1114
{
15+
/// <summary>
16+
/// Backing BindableProperty for the <see cref="Command"/> property.
17+
/// </summary>
1218
public static readonly BindableProperty CommandProperty
1319
= BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(MaxLengthReachedBehavior));
1420

21+
/// <summary>
22+
/// Command that is triggered when the value configured in <see cref="InputView.MaxLength" /> is reached. Both the <see cref="MaxLengthReached"/> event and this command are triggered. This is a bindable property.
23+
/// </summary>
1524
public ICommand Command
1625
{
1726
get => (ICommand)GetValue(CommandProperty);
1827
set => SetValue(CommandProperty, value);
1928
}
2029

30+
/// <summary>
31+
/// Backing BindableProperty for the <see cref="ShouldDismissKeyboardAutomatically"/> property.
32+
/// </summary>
2133
public static readonly BindableProperty ShouldDismissKeyboardAutomaticallyProperty
2234
= BindableProperty.Create(nameof(ShouldDismissKeyboardAutomatically), typeof(bool), typeof(MaxLengthReachedBehavior), false);
2335

36+
/// <summary>
37+
/// Indicates whether or not the keyboard should be dismissed automatically after the maximum length is reached. This is a bindable property.
38+
/// </summary>
2439
public bool ShouldDismissKeyboardAutomatically
2540
{
2641
get => (bool)GetValue(ShouldDismissKeyboardAutomaticallyProperty);
@@ -29,6 +44,9 @@ public bool ShouldDismissKeyboardAutomatically
2944

3045
readonly WeakEventManager<MaxLengthReachedEventArgs> maxLengthReachedEventManager = new WeakEventManager<MaxLengthReachedEventArgs>();
3146

47+
/// <summary>
48+
/// Event that is triggered when the value configured in <see cref="InputView.MaxLength" /> is reached. Both the <see cref="Command"/> and this event are triggered. This is a bindable property.
49+
/// </summary>
3250
public event EventHandler<MaxLengthReachedEventArgs> MaxLengthReached
3351
{
3452
add => maxLengthReachedEventManager.AddEventHandler(value);

src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/MaxLengthReachedEventArgs.shared.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22

33
namespace Xamarin.CommunityToolkit.Behaviors
44
{
5+
/// <summary>
6+
/// Container object for the event arguments that are provided when the <see cref="MaxLengthReachedBehavior.MaxLengthReached"/> event is triggered.
7+
/// </summary>
58
public class MaxLengthReachedEventArgs : EventArgs
69
{
10+
/// <summary>
11+
/// The new text value as determined by the <see cref="MaxLengthReachedBehavior"/>
12+
/// </summary>
713
public string Text { get; }
814

15+
/// <summary>
16+
/// Constructor to create a new instance of <see cref="MaxLengthReachedEventArgs"/>.
17+
/// </summary>
18+
/// <param name="text">The new text value as determined by the <see cref="MaxLengthReachedBehavior"/></param>
919
public MaxLengthReachedEventArgs(string text)
1020
=> Text = text;
1121
}

0 commit comments

Comments
 (0)