title: Can't move to Next Entry and Set Focus on it in Xamarin
body: <p>In my Xamarin app, I want that when value is being entered in an Entry, it automatically finds next Entry field and set focus to it.</p>
  <p>I can move to next entry with <strong>Next</strong> button in keyboard, but I want to set focus on next entry automatically when value is entered (max length is 1 character).</p>
  <p>I also tried <a href="https://stackoverflow.com/a/55212336/14139029">this code</a>, but it didn't work.</p>
  <p><strong>.xml</strong></p>
  <pre><code>xmlns:behaviors=&quot;clr-namespace:Mobile.App.Behaviors&quot;
  </code></pre>
  <pre><code>&lt;Grid Grid.Column=&quot;1&quot;&gt;
      &lt;Frame CornerRadius=&quot;12&quot;&gt;
          &lt;BoxView Color=&quot;#EEEEEE&quot; /&gt;
      &lt;/Frame&gt;
      &lt;Entry
          x:Name=&quot;PasswordOne&quot;
          Text=&quot;{Binding PasswordOne}&quot;
          IsPassword=&quot;True&quot;
          Keyboard=&quot;Numeric&quot;
          MaxLength=&quot;1&quot;
          ReturnType=&quot;Next&quot;
          Unfocused=&quot;Password_Unfocused&quot;&gt;
          &lt;Entry.Behaviors&gt;
              &lt;behaviors:FocusOnReturnBehavior FocusOn=&quot;{x:Reference PasswordTwo}&quot; /&gt;
          &lt;/Entry.Behaviors&gt;
      &lt;/Entry&gt;
  &lt;/Grid&gt;
  
  &lt;Grid Grid.Column=&quot;2&quot;&gt;
      &lt;Frame CornerRadius=&quot;12&quot;&gt;
          &lt;BoxView Color=&quot;#EEEEEE&quot; /&gt;
      &lt;/Frame&gt;
      &lt;Entry
          x:Name=&quot;PasswordTwo&quot;
          Text=&quot;{Binding PasswordTwo}&quot;
          IsPassword=&quot;True&quot;
          Keyboard=&quot;Numeric&quot;
          MaxLength=&quot;1&quot;
          ReturnType=&quot;Next&quot;
          Unfocused=&quot;Password_Unfocused&quot;&gt;
          &lt;Entry.Behaviors&gt;
              &lt;behaviors:FocusOnReturnBehavior FocusOn=&quot;{x:Reference PasswordThree}&quot; /&gt;
          &lt;/Entry.Behaviors&gt;
      &lt;/Entry&gt;
  &lt;/Grid&gt;
  </code></pre>
  <p><strong>FocusOnReturnBehavior.cs</strong></p>
  <pre><code>public class FocusOnReturnBehavior : Behavior&lt;Entry&gt;
  {
      public VisualElement FocusOn { get; set; }
  
      protected override void OnAttachedTo(Entry bindable)
      {
          base.OnAttachedTo(bindable);
          bindable.Completed += BindableOnCompleted;
      }
  
  
      protected override void OnDetachingFrom(Entry bindable)
      {
          base.OnDetachingFrom(bindable);
          bindable.Completed -= BindableOnCompleted;
      }
  
      private void BindableOnCompleted(object sender, EventArgs args)
      {
          FocusOn?.Focus();
      }
  }
  </code></pre>