Ejemplo n.º 1
0
        public async Task OnMoveKeyboardFocus_ItReceivesKeyboardFocus()
        {
            IWindow window = await App.CreateWindowWithContent(@"
<Grid>
  <TextBox x:Name=""MyTextBox"" />
</Grid>");

            IVisualElement element = await window.GetElement("/Grid~MyTextBox");

            Assert.IsFalse(await element.GetIsKeyboardFocused());

            await element.MoveKeyboardFocus();

            Assert.IsTrue(await element.GetIsKeyboardFocused());
        }
Ejemplo n.º 2
0
        public async Task OnMoveKeyboardFocus_ItReceivesKeyboardFocus()
        {
            await Window.SetXamlContent(@"
<Grid>
  <TextBox x:Name=""MyTextBox"" />
</Grid>");

            IVisualElement <TextBox> element = await Window.GetElement <TextBox>("/Grid~MyTextBox");

            Assert.IsFalse(await element.GetIsKeyboardFocused());

            await element.MoveKeyboardFocus();

            Assert.IsTrue(await element.GetIsKeyboardFocused());
        }