KeyboardNavigationTests_Arrows.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using Perspex.Controls;
  4. using Xunit;
  5. namespace Perspex.Input.UnitTests
  6. {
  7. using Controls = Controls.Controls;
  8. public class KeyboardNavigationTests_Arrows
  9. {
  10. [Fact]
  11. public void Down_Continue_Returns_Down_Control_In_Container()
  12. {
  13. StackPanel container;
  14. Button current;
  15. Button next;
  16. var top = new StackPanel
  17. {
  18. Children = new Controls
  19. {
  20. (container = new StackPanel
  21. {
  22. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  23. Children = new Controls
  24. {
  25. new Button { Name = "Button1" },
  26. (current = new Button { Name = "Button2" }),
  27. (next = new Button { Name = "Button3" }),
  28. }
  29. }),
  30. new StackPanel
  31. {
  32. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  33. Children = new Controls
  34. {
  35. new Button { Name = "Button4" },
  36. new Button { Name = "Button5" },
  37. new Button { Name = "Button6" },
  38. }
  39. },
  40. }
  41. };
  42. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  43. Assert.Equal(next, result);
  44. }
  45. [Fact]
  46. public void Down_Continue_Returns_First_Control_In_Down_Sibling_Container()
  47. {
  48. StackPanel container;
  49. Button current;
  50. Button next;
  51. var top = new StackPanel
  52. {
  53. Children = new Controls
  54. {
  55. (container = new StackPanel
  56. {
  57. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  58. Children = new Controls
  59. {
  60. new Button { Name = "Button1" },
  61. new Button { Name = "Button2" },
  62. (current = new Button { Name = "Button3" }),
  63. }
  64. }),
  65. new StackPanel
  66. {
  67. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  68. Children = new Controls
  69. {
  70. (next = new Button { Name = "Button4" }),
  71. new Button { Name = "Button5" },
  72. new Button { Name = "Button6" },
  73. }
  74. },
  75. }
  76. };
  77. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  78. Assert.Equal(next, result);
  79. }
  80. [Fact]
  81. public void Down_Continue_Returns_Down_Sibling()
  82. {
  83. StackPanel container;
  84. Button current;
  85. Button next;
  86. var top = new StackPanel
  87. {
  88. Children = new Controls
  89. {
  90. (container = new StackPanel
  91. {
  92. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  93. Children = new Controls
  94. {
  95. new Button { Name = "Button1" },
  96. new Button { Name = "Button2" },
  97. (current = new Button { Name = "Button3" }),
  98. }
  99. }),
  100. (next = new Button { Name = "Button4" }),
  101. }
  102. };
  103. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  104. Assert.Equal(next, result);
  105. }
  106. [Fact]
  107. public void Down_Continue_Returns_First_Control_In_Down_Uncle_Container()
  108. {
  109. StackPanel container;
  110. Button current;
  111. Button next;
  112. var top = new StackPanel
  113. {
  114. Children = new Controls
  115. {
  116. new StackPanel
  117. {
  118. Children = new Controls
  119. {
  120. (container = new StackPanel
  121. {
  122. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  123. Children = new Controls
  124. {
  125. new Button { Name = "Button1" },
  126. new Button { Name = "Button2" },
  127. (current = new Button { Name = "Button3" }),
  128. }
  129. }),
  130. },
  131. },
  132. new StackPanel
  133. {
  134. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  135. Children = new Controls
  136. {
  137. (next = new Button { Name = "Button4" }),
  138. new Button { Name = "Button5" },
  139. new Button { Name = "Button6" },
  140. }
  141. },
  142. }
  143. };
  144. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  145. Assert.Equal(next, result);
  146. }
  147. [Fact]
  148. public void Down_Continue_Returns_Child_Of_Top_Level()
  149. {
  150. Button next;
  151. var top = new StackPanel
  152. {
  153. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  154. Children = new Controls
  155. {
  156. (next = new Button { Name = "Button1" }),
  157. }
  158. };
  159. var result = KeyboardNavigationHandler.GetNext(top, FocusNavigationDirection.Down);
  160. Assert.Equal(next, result);
  161. }
  162. [Fact]
  163. public void Down_Continue_Wraps()
  164. {
  165. StackPanel container;
  166. Button current;
  167. Button next;
  168. var top = new StackPanel
  169. {
  170. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  171. Children = new Controls
  172. {
  173. new StackPanel
  174. {
  175. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  176. Children = new Controls
  177. {
  178. (container = new StackPanel
  179. {
  180. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  181. Children = new Controls
  182. {
  183. (next = new Button { Name = "Button1" }),
  184. new Button { Name = "Button2" },
  185. new Button { Name = "Button3" },
  186. }
  187. }),
  188. },
  189. },
  190. new StackPanel
  191. {
  192. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  193. Children = new Controls
  194. {
  195. new Button { Name = "Button4" },
  196. new Button { Name = "Button5" },
  197. (current = new Button { Name = "Button6" }),
  198. }
  199. },
  200. }
  201. };
  202. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  203. Assert.Equal(next, result);
  204. }
  205. [Fact]
  206. public void Down_Cycle_Returns_Down_Control_In_Container()
  207. {
  208. StackPanel container;
  209. Button current;
  210. Button next;
  211. var top = new StackPanel
  212. {
  213. Children = new Controls
  214. {
  215. (container = new StackPanel
  216. {
  217. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  218. Children = new Controls
  219. {
  220. new Button { Name = "Button1" },
  221. (current = new Button { Name = "Button2" }),
  222. (next = new Button { Name = "Button3" }),
  223. }
  224. }),
  225. new StackPanel
  226. {
  227. Children = new Controls
  228. {
  229. new Button { Name = "Button4" },
  230. new Button { Name = "Button5" },
  231. new Button { Name = "Button6" },
  232. }
  233. },
  234. }
  235. };
  236. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  237. Assert.Equal(next, result);
  238. }
  239. [Fact]
  240. public void Down_Cycle_Wraps_To_First()
  241. {
  242. StackPanel container;
  243. Button current;
  244. Button next;
  245. var top = new StackPanel
  246. {
  247. Children = new Controls
  248. {
  249. (container = new StackPanel
  250. {
  251. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  252. Children = new Controls
  253. {
  254. (next = new Button { Name = "Button1" }),
  255. new Button { Name = "Button2" },
  256. (current = new Button { Name = "Button3" }),
  257. }
  258. }),
  259. new StackPanel
  260. {
  261. Children = new Controls
  262. {
  263. new Button { Name = "Button4" },
  264. new Button { Name = "Button5" },
  265. new Button { Name = "Button6" },
  266. }
  267. },
  268. }
  269. };
  270. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  271. Assert.Equal(next, result);
  272. }
  273. [Fact]
  274. public void Down_Contained_Returns_Down_Control_In_Container()
  275. {
  276. StackPanel container;
  277. Button current;
  278. Button next;
  279. var top = new StackPanel
  280. {
  281. Children = new Controls
  282. {
  283. (container = new StackPanel
  284. {
  285. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  286. Children = new Controls
  287. {
  288. new Button { Name = "Button1" },
  289. (current = new Button { Name = "Button2" }),
  290. (next = new Button { Name = "Button3" }),
  291. }
  292. }),
  293. new StackPanel
  294. {
  295. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  296. Children = new Controls
  297. {
  298. new Button { Name = "Button4" },
  299. new Button { Name = "Button5" },
  300. new Button { Name = "Button6" },
  301. }
  302. },
  303. }
  304. };
  305. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  306. Assert.Equal(next, result);
  307. }
  308. [Fact]
  309. public void Down_Contained_Stops_At_End()
  310. {
  311. StackPanel container;
  312. Button current;
  313. Button next;
  314. var top = new StackPanel
  315. {
  316. Children = new Controls
  317. {
  318. (container = new StackPanel
  319. {
  320. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  321. Children = new Controls
  322. {
  323. (next = new Button { Name = "Button1" }),
  324. new Button { Name = "Button2" },
  325. (current = new Button { Name = "Button3" }),
  326. }
  327. }),
  328. new StackPanel
  329. {
  330. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  331. Children = new Controls
  332. {
  333. new Button { Name = "Button4" },
  334. new Button { Name = "Button5" },
  335. new Button { Name = "Button6" },
  336. }
  337. },
  338. }
  339. };
  340. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  341. Assert.Null(result);
  342. }
  343. [Fact]
  344. public void Down_None_Does_Nothing()
  345. {
  346. StackPanel container;
  347. Button current;
  348. var top = new StackPanel
  349. {
  350. Children = new Controls
  351. {
  352. (container = new StackPanel
  353. {
  354. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.None,
  355. Children = new Controls
  356. {
  357. new Button { Name = "Button1" },
  358. (current = new Button { Name = "Button2" }),
  359. new Button { Name = "Button3" },
  360. }
  361. }),
  362. new StackPanel
  363. {
  364. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  365. Children = new Controls
  366. {
  367. new Button { Name = "Button4" },
  368. new Button { Name = "Button5" },
  369. new Button { Name = "Button6" },
  370. }
  371. },
  372. }
  373. };
  374. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Down);
  375. Assert.Null(result);
  376. }
  377. [Fact]
  378. public void Up_Continue_Returns_Up_Control_In_Container()
  379. {
  380. StackPanel container;
  381. Button current;
  382. Button next;
  383. var top = new StackPanel
  384. {
  385. Children = new Controls
  386. {
  387. (container = new StackPanel
  388. {
  389. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  390. Children = new Controls
  391. {
  392. new Button { Name = "Button1" },
  393. (next = new Button { Name = "Button2" }),
  394. (current = new Button { Name = "Button3" }),
  395. }
  396. }),
  397. new StackPanel
  398. {
  399. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  400. Children = new Controls
  401. {
  402. new Button { Name = "Button4" },
  403. new Button { Name = "Button5" },
  404. new Button { Name = "Button6" },
  405. }
  406. },
  407. }
  408. };
  409. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  410. Assert.Equal(next, result);
  411. }
  412. [Fact]
  413. public void Up_Continue_Returns_Last_Control_In_Up_Sibling_Container()
  414. {
  415. StackPanel container;
  416. Button current;
  417. Button next;
  418. var top = new StackPanel
  419. {
  420. Children = new Controls
  421. {
  422. (container = new StackPanel
  423. {
  424. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  425. Children = new Controls
  426. {
  427. new Button { Name = "Button1" },
  428. new Button { Name = "Button2" },
  429. (next = new Button { Name = "Button3" }),
  430. }
  431. }),
  432. new StackPanel
  433. {
  434. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  435. Children = new Controls
  436. {
  437. (current = new Button { Name = "Button4" }),
  438. new Button { Name = "Button5" },
  439. new Button { Name = "Button6" },
  440. }
  441. },
  442. }
  443. };
  444. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  445. Assert.Equal(next, result);
  446. }
  447. [Fact]
  448. public void Up_Continue_Returns_Last_Child_Of_Sibling()
  449. {
  450. StackPanel container;
  451. Button current;
  452. Button next;
  453. var top = new StackPanel
  454. {
  455. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  456. Children = new Controls
  457. {
  458. (container = new StackPanel
  459. {
  460. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  461. Children = new Controls
  462. {
  463. new Button { Name = "Button1" },
  464. new Button { Name = "Button2" },
  465. (next = new Button { Name = "Button3" }),
  466. }
  467. }),
  468. (current = new Button { Name = "Button4" }),
  469. }
  470. };
  471. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  472. Assert.Equal(next, result);
  473. }
  474. [Fact]
  475. public void Up_Continue_Returns_Last_Control_In_Up_Nephew_Container()
  476. {
  477. StackPanel container;
  478. Button current;
  479. Button next;
  480. var top = new StackPanel
  481. {
  482. Children = new Controls
  483. {
  484. new StackPanel
  485. {
  486. Children = new Controls
  487. {
  488. (container = new StackPanel
  489. {
  490. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  491. Children = new Controls
  492. {
  493. new Button { Name = "Button1" },
  494. new Button { Name = "Button2" },
  495. (next = new Button { Name = "Button3" }),
  496. }
  497. }),
  498. },
  499. },
  500. new StackPanel
  501. {
  502. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  503. Children = new Controls
  504. {
  505. (current = new Button { Name = "Button4" }),
  506. new Button { Name = "Button5" },
  507. new Button { Name = "Button6" },
  508. }
  509. },
  510. }
  511. };
  512. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  513. Assert.Equal(next, result);
  514. }
  515. [Fact]
  516. public void Up_Continue_Wraps()
  517. {
  518. StackPanel container;
  519. Button current;
  520. Button next;
  521. var top = new StackPanel
  522. {
  523. Children = new Controls
  524. {
  525. new StackPanel
  526. {
  527. Children = new Controls
  528. {
  529. (container = new StackPanel
  530. {
  531. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  532. Children = new Controls
  533. {
  534. (current = new Button { Name = "Button1" }),
  535. new Button { Name = "Button2" },
  536. new Button { Name = "Button3" },
  537. }
  538. }),
  539. },
  540. },
  541. new StackPanel
  542. {
  543. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  544. Children = new Controls
  545. {
  546. new Button { Name = "Button4" },
  547. new Button { Name = "Button5" },
  548. (next = new Button { Name = "Button6" }),
  549. }
  550. },
  551. }
  552. };
  553. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  554. Assert.Equal(next, result);
  555. }
  556. [Fact]
  557. public void Up_Continue_Returns_Parent()
  558. {
  559. Button current;
  560. var top = new Decorator
  561. {
  562. Focusable = true,
  563. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue,
  564. Child = current = new Button
  565. {
  566. Name = "Button",
  567. }
  568. };
  569. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  570. Assert.Equal(top, result);
  571. }
  572. [Fact]
  573. public void Up_Cycle_Returns_Up_Control_In_Container()
  574. {
  575. StackPanel container;
  576. Button current;
  577. Button next;
  578. var top = new StackPanel
  579. {
  580. Children = new Controls
  581. {
  582. (container = new StackPanel
  583. {
  584. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  585. Children = new Controls
  586. {
  587. (next = new Button { Name = "Button1" }),
  588. (current = new Button { Name = "Button2" }),
  589. new Button { Name = "Button3" },
  590. }
  591. }),
  592. new StackPanel
  593. {
  594. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  595. Children = new Controls
  596. {
  597. new Button { Name = "Button4" },
  598. new Button { Name = "Button5" },
  599. new Button { Name = "Button6" },
  600. }
  601. },
  602. }
  603. };
  604. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  605. Assert.Equal(next, result);
  606. }
  607. [Fact]
  608. public void Up_Cycle_Wraps_To_Last()
  609. {
  610. StackPanel container;
  611. Button current;
  612. Button next;
  613. var top = new StackPanel
  614. {
  615. Children = new Controls
  616. {
  617. (container = new StackPanel
  618. {
  619. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  620. Children = new Controls
  621. {
  622. (current = new Button { Name = "Button1" }),
  623. new Button { Name = "Button2" },
  624. (next = new Button { Name = "Button3" }),
  625. }
  626. }),
  627. new StackPanel
  628. {
  629. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle,
  630. Children = new Controls
  631. {
  632. new Button { Name = "Button4" },
  633. new Button { Name = "Button5" },
  634. new Button { Name = "Button6" },
  635. }
  636. },
  637. }
  638. };
  639. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  640. Assert.Equal(next, result);
  641. }
  642. [Fact]
  643. public void Up_Contained_Returns_Up_Control_In_Container()
  644. {
  645. StackPanel container;
  646. Button current;
  647. Button next;
  648. var top = new StackPanel
  649. {
  650. Children = new Controls
  651. {
  652. (container = new StackPanel
  653. {
  654. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  655. Children = new Controls
  656. {
  657. (next = new Button { Name = "Button1" }),
  658. (current = new Button { Name = "Button2" }),
  659. new Button { Name = "Button3" },
  660. }
  661. }),
  662. new StackPanel
  663. {
  664. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  665. Children = new Controls
  666. {
  667. new Button { Name = "Button4" },
  668. new Button { Name = "Button5" },
  669. new Button { Name = "Button6" },
  670. }
  671. },
  672. }
  673. };
  674. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  675. Assert.Equal(next, result);
  676. }
  677. [Fact]
  678. public void Up_Contained_Stops_At_Beginning()
  679. {
  680. StackPanel container;
  681. Button current;
  682. var top = new StackPanel
  683. {
  684. Children = new Controls
  685. {
  686. (container = new StackPanel
  687. {
  688. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  689. Children = new Controls
  690. {
  691. (current = new Button { Name = "Button1" }),
  692. new Button { Name = "Button2" },
  693. new Button { Name = "Button3" },
  694. }
  695. }),
  696. new StackPanel
  697. {
  698. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  699. Children = new Controls
  700. {
  701. new Button { Name = "Button4" },
  702. new Button { Name = "Button5" },
  703. new Button { Name = "Button6" },
  704. }
  705. },
  706. }
  707. };
  708. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  709. Assert.Null(result);
  710. }
  711. [Fact]
  712. public void Up_Contained_Doesnt_Return_Child_Control()
  713. {
  714. Decorator current;
  715. var top = new StackPanel
  716. {
  717. [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Contained,
  718. Children = new Controls
  719. {
  720. (current = new Decorator
  721. {
  722. Focusable = true,
  723. Child = new Button(),
  724. })
  725. }
  726. };
  727. var result = KeyboardNavigationHandler.GetNext(current, FocusNavigationDirection.Up);
  728. Assert.Null(result);
  729. }
  730. }
  731. }