-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implemented MaxLength property on Entry and Editor #1880
Changes from 16 commits
cd6585f
b02f8a8
2ab7fb4
6e44c7c
4c75dfd
c2301aa
c9283bc
87d5a03
1af5e74
1d002b9
47560bd
43eacf0
c037575
07ad020
d919eba
947699f
c41f0ba
8983dcc
a03182a
0263892
f5f7a26
da2a571
d78f007
416e287
009272e
3b3fc3a
db6461a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,14 @@ public class InputView : View | |
public static readonly BindableProperty KeyboardProperty = BindableProperty.Create("Keyboard", typeof(Keyboard), typeof(InputView), Keyboard.Default, | ||
coerceValue: (o, v) => (Keyboard)v ?? Keyboard.Default); | ||
|
||
public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create("MaxLength", typeof(int), typeof(int), int.MaxValue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we usually use tabs for indentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the #1663 we sort of decided to go with int.MaxValue. What would be the benefit of using -1? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll discuss the defaultValue with @hartez. both are fine, both make sense. But having Int32.MaxValue prevents us from having a really long text in, while -1 does not. |
||
|
||
public int MaxLength | ||
{ | ||
get { return (int)GetValue(MaxLengthProperty); } | ||
set { SetValue(MaxLengthProperty, value); } | ||
} | ||
|
||
internal InputView() | ||
{ | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funky whitespace for fun and profit :)