Skip to content

Commit

Permalink
Rename properties to better reflect purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
DevFromDownUnder committed Mar 25, 2024
1 parent d79c95b commit 85980d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ public partial class TextField
propertyChanged: (bindable, oldValue, newValue) => EntryProperties.SetSelectionHighlightColor(bindable, (Color)newValue)
);

public bool DisallowEndIconFocus { get => (bool)GetValue(DisallowEndIconFocusProperty); set => SetValue(DisallowEndIconFocusProperty, value); }
public bool DisallowClearButtonFocus { get => (bool)GetValue(DisallowClearButtonFocusProperty); set => SetValue(DisallowClearButtonFocusProperty, value); }

public static BindableProperty DisallowEndIconFocusProperty = BindableProperty.Create(
nameof(DisallowEndIconFocus),
public static BindableProperty DisallowClearButtonFocusProperty = BindableProperty.Create(
nameof(DisallowClearButtonFocus),
typeof(bool),
typeof(TextField),
false,
propertyChanged: (bindable, oldValue, newValue) => {
(bindable as TextField).ValidateFocus();
(bindable as TextField).ValidateClearButtonFocus();
});
}
10 changes: 5 additions & 5 deletions src/UraniumUI.Material/Controls/TextField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public TextField()
EntryView.SetBinding(Entry.IsEnabledProperty, new Binding(nameof(IsEnabled), source: this));
EntryView.SetBinding(Entry.IsReadOnlyProperty, new Binding(nameof(IsReadOnly), source: this));

iconClear.Focused += (s, e) => { ValidateFocus(); };
iconClear.Focused += (s, e) => { ValidateClearButtonFocus(); };

AfterConstructor();
}
Expand Down Expand Up @@ -151,11 +151,11 @@ public override void ResetValidation()
base.ResetValidation();
}

#region DisallowEndIconsFocus Logic
#region DisallowClearButtonFocus Logic

protected void ValidateFocus()
protected void ValidateClearButtonFocus()
{
if (DisallowEndIconFocus)
if (DisallowClearButtonFocus)
{
var controlToFocus = GetNextExternalFocusableControl();

Expand All @@ -173,5 +173,5 @@ protected IView GetNextExternalFocusableControl()
return UraniumUI.Extensions.ViewExtensions.GetNextElement(this.Parent, this) as IView;
}

#endregion DisallowEndIconsFocus Logic
#endregion DisallowClearButtonFocus Logic
}

0 comments on commit 85980d8

Please sign in to comment.