Skip to content
Sample application demonstrating how to use behaviors to move between fields
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

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">
        <behaviors:SetFocusOnEntryCompletedBehavior  TargetElement="{x:Reference Entry2}" />

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

You can’t perform that action at this time.