Skip to content

Sample application demonstrating how to use behaviors to move between fields

License

Notifications You must be signed in to change notification settings

adenearnshaw/xam-focus-next-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xamarin Forms: Focus next element sample

Here is a simple Xamarin Forms sample app that demonstrates how you can attach a behavior to an Entry element and move the focus to another element when the user clicks enter on the keyboard.

Using the behavior

Give the element you wish to focus on a name:

<Entry x:Name="Entry2" Placeholder="Field 2"/>

On the element you wish to navigate from, add the behavior and add a reference to the named element.

<Entry Placeholder="Field 1">
    <Entry.Behaviors>
        <behaviors:SetFocusOnEntryCompletedBehavior  TargetElement="{x:Reference Entry2}" />
    </Entry.Behaviors>
</Entry>

When the user presses enter whilst on "Field 1", then focus will moved to "Field 2"

About

Sample application demonstrating how to use behaviors to move between fields

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages