Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
SetFocusOnCompletedBehavior.cs
1
using
System.ComponentModel;
2
using
NeuroAccessMaui.UI.Controls
;
3
4
namespace
NeuroAccessMaui.UI.Behaviors
5
{
9
public
class
SetFocusOnCompletedBehavior
: Behavior<CompositeEntry>
10
{
14
[TypeConverter(typeof(ReferenceTypeConverter))]
15
public
View?
SetFocusTo
{
get
;
set
; }
16
20
[TypeConverter(typeof(ReferenceTypeConverter))]
21
public
View?
SetFocusToAlternative
{
get
;
set
; }
22
26
public
static
readonly BindableProperty
UseAlternativeProperty
=
27
BindableProperty.Create(nameof(
UseAlternative
), typeof(
bool
), typeof(
SetFocusOnCompletedBehavior
),
default
);
28
32
public
bool
UseAlternative
33
{
34
get
=> (bool)this.GetValue(
UseAlternativeProperty
);
35
set
=> this.SetValue(
UseAlternativeProperty
, value);
36
}
37
39
protected
override
void
OnAttachedTo
(
CompositeEntry
entry)
40
{
41
entry.Completed += this.Entry_Completed;
42
base.OnAttachedTo(entry);
43
}
44
46
protected
override
void
OnDetachingFrom
(
CompositeEntry
entry)
47
{
48
entry.Completed -= this.Entry_Completed;
49
base.OnDetachingFrom(entry);
50
}
51
52
private
void
Entry_Completed(
object
? Sender, EventArgs e)
53
{
54
if
(this.
UseAlternative
&& this.
SetFocusToAlternative
is not
null
)
55
SetFocusOnClickedBehavior
.
FocusOn
(this.
SetFocusToAlternative
);
56
else
57
SetFocusOnClickedBehavior
.
FocusOn
(this.
SetFocusTo
!);
58
}
59
}
60
}
NeuroAccessMaui.UI.Behaviors.SetFocusOnClickedBehavior
Used for moving focus to the next UI component when a button has been clicked.
Definition:
SetFocusOnClickedBehavior.cs:9
NeuroAccessMaui.UI.Behaviors.SetFocusOnClickedBehavior.FocusOn
static void FocusOn(View Element)
Sets focus on an element.
Definition:
SetFocusOnClickedBehavior.cs:47
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior
Used for moving focus to the next UI component when the Enter/Return key has been hit.
Definition:
SetFocusOnCompletedBehavior.cs:10
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.OnDetachingFrom
override void OnDetachingFrom(CompositeEntry entry)
Definition:
SetFocusOnCompletedBehavior.cs:46
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.SetFocusToAlternative
View? SetFocusToAlternative
Alternative view to move focus to.
Definition:
SetFocusOnCompletedBehavior.cs:21
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.SetFocusTo
View? SetFocusTo
The view to move focus to.
Definition:
SetFocusOnCompletedBehavior.cs:15
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.OnAttachedTo
override void OnAttachedTo(CompositeEntry entry)
Definition:
SetFocusOnCompletedBehavior.cs:39
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.UseAlternativeProperty
static readonly BindableProperty UseAlternativeProperty
Makes UseAlternative bindable.
Definition:
SetFocusOnCompletedBehavior.cs:26
NeuroAccessMaui.UI.Behaviors.SetFocusOnCompletedBehavior.UseAlternative
bool UseAlternative
If alternative control should be used.
Definition:
SetFocusOnCompletedBehavior.cs:33
NeuroAccessMaui.UI.Controls.CompositeEntry
A customizable entry control that allows setting views on the left and right sides of the entry.
Definition:
CompositeEntry.cs:13
NeuroAccessMaui.UI.Behaviors
Definition:
HideKeyboardOnCompletedBehavior.cs:5
NeuroAccessMaui.UI.Controls
Definition:
AnimatedCheckbox.cs:4
NeuroAccessMaui
NeuroAccessMaui
UI
Behaviors
SetFocusOnCompletedBehavior.cs
Generated by
1.9.5