Trigger event on discarding keyboard

In the following example the TextInput’s Background changes when focused. However when I tap the down arrow (left button on the bottom menu) on the Android keyboard and the keyboard discards, the TextInput stays in focus. How can I lose focus of the TextInput when discarding the keyboard?

<App>
  <TextInput ux:Name="TextInput" Width="100%" Height="50" Background="#0000ff">
    <WhileFocused>
      <Set TextInput.Background="#ff0000" />
    </WhileFocused>
    <WhileNotFocused>
      <Set TextInput.Background="#0000ff" />
    </WhileNotFocused>
  </TextInput>
</App>

Use ReleaseFocus.

Thanks for the suggestion! However TextInputActionTriggered doesn’t fire when the keyboard is discarded by pressing the bottom left button. It only fires when the TextInput is submitted (pressing “next”).

Well there’s always WhileKeyboardVisible, which conveniently comes with an Invert property too, just like the other While*-triggers.

Thanks Uldis! Works great!

Thanks a lot for this wonderful communication. As I got to learn a lot and got all my queries solved over from here.