SplitViewTests.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. using System;
  2. using System.Linq;
  3. using Terminal.Gui;
  4. using Xunit;
  5. using Xunit.Abstractions;
  6. namespace UnitTests {
  7. public class SplitViewTests {
  8. readonly ITestOutputHelper output;
  9. public SplitViewTests (ITestOutputHelper output)
  10. {
  11. this.output = output;
  12. }
  13. [Fact, AutoInitShutdown]
  14. public void TestSplitView_Vertical ()
  15. {
  16. var splitContainer = Get11By3SplitView (out var line);
  17. splitContainer.Redraw (splitContainer.Bounds);
  18. string looksLike =
  19. @"
  20. 11111│22222
  21. 11111│22222
  22. │ ";
  23. TestHelpers.AssertDriverContentsAre (looksLike, output);
  24. // Keyboard movement on splitter should have no effect if it is not focused
  25. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  26. splitContainer.SetNeedsDisplay ();
  27. splitContainer.Redraw (splitContainer.Bounds);
  28. TestHelpers.AssertDriverContentsAre (looksLike, output);
  29. }
  30. [Fact, AutoInitShutdown]
  31. public void TestSplitView_Vertical_WithBorder ()
  32. {
  33. var splitContainer = Get11By3SplitView (out var line, true);
  34. splitContainer.Redraw (splitContainer.Bounds);
  35. string looksLike =
  36. @"
  37. ┌────┬────┐
  38. │1111│2222│
  39. └────┴────┘";
  40. TestHelpers.AssertDriverContentsAre (looksLike, output);
  41. // Keyboard movement on splitter should have no effect if it is not focused
  42. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  43. splitContainer.SetNeedsDisplay ();
  44. splitContainer.Redraw (splitContainer.Bounds);
  45. TestHelpers.AssertDriverContentsAre (looksLike, output);
  46. }
  47. [Fact, AutoInitShutdown]
  48. public void TestSplitView_Vertical_Focused ()
  49. {
  50. var splitContainer = Get11By3SplitView (out var line);
  51. SetInputFocusLine (splitContainer);
  52. splitContainer.Redraw (splitContainer.Bounds);
  53. string looksLike =
  54. @"
  55. 11111│22222
  56. 11111◊22222
  57. │ ";
  58. TestHelpers.AssertDriverContentsAre (looksLike, output);
  59. // Now while focused move the splitter 1 unit right
  60. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  61. splitContainer.Redraw (splitContainer.Bounds);
  62. looksLike =
  63. @"
  64. 111111│2222
  65. 111111◊2222
  66. │ ";
  67. TestHelpers.AssertDriverContentsAre (looksLike, output);
  68. // and 2 to the left
  69. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  70. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  71. splitContainer.Redraw (splitContainer.Bounds);
  72. looksLike =
  73. @"
  74. 1111│222222
  75. 1111◊222222
  76. │ ";
  77. TestHelpers.AssertDriverContentsAre (looksLike, output);
  78. }
  79. [Fact, AutoInitShutdown]
  80. public void TestSplitView_Vertical_Focused_WithBorder ()
  81. {
  82. var splitContainer = Get11By3SplitView (out var line, true);
  83. SetInputFocusLine (splitContainer);
  84. splitContainer.Redraw (splitContainer.Bounds);
  85. string looksLike =
  86. @"
  87. ┌────┬────┐
  88. │1111◊2222│
  89. └────┴────┘";
  90. TestHelpers.AssertDriverContentsAre (looksLike, output);
  91. // Now while focused move the splitter 1 unit right
  92. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  93. splitContainer.Redraw (splitContainer.Bounds);
  94. looksLike =
  95. @"
  96. ┌─────┬───┐
  97. │11111◊222│
  98. └─────┴───┘";
  99. TestHelpers.AssertDriverContentsAre (looksLike, output);
  100. // and 2 to the left
  101. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  102. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  103. splitContainer.Redraw (splitContainer.Bounds);
  104. looksLike =
  105. @"
  106. ┌───┬─────┐
  107. │111◊22222│
  108. └───┴─────┘";
  109. TestHelpers.AssertDriverContentsAre (looksLike, output);
  110. }
  111. [Fact, AutoInitShutdown]
  112. public void TestSplitView_Vertical_Focused_50PercentSplit ()
  113. {
  114. var splitContainer = Get11By3SplitView (out var line);
  115. SetInputFocusLine (splitContainer);
  116. splitContainer.SetSplitterPos(0,Pos.Percent (50));
  117. Assert.IsType<Pos.PosFactor> (splitContainer.SplitterDistances.ElementAt(0));
  118. splitContainer.Redraw (splitContainer.Bounds);
  119. string looksLike =
  120. @"
  121. 11111│22222
  122. 11111◊22222
  123. │ ";
  124. TestHelpers.AssertDriverContentsAre (looksLike, output);
  125. // Now while focused move the splitter 1 unit right
  126. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  127. splitContainer.Redraw (splitContainer.Bounds);
  128. looksLike =
  129. @"
  130. 111111│2222
  131. 111111◊2222
  132. │ ";
  133. TestHelpers.AssertDriverContentsAre (looksLike, output);
  134. // Even when moving the splitter location it should stay a Percentage based one
  135. Assert.IsType<Pos.PosFactor> (splitContainer.SplitterDistances.ElementAt(0));
  136. // and 2 to the left
  137. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  138. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  139. splitContainer.Redraw (splitContainer.Bounds);
  140. looksLike =
  141. @"
  142. 1111│222222
  143. 1111◊222222
  144. │ ";
  145. TestHelpers.AssertDriverContentsAre (looksLike, output);
  146. // Even when moving the splitter location it should stay a Percentage based one
  147. Assert.IsType<Pos.PosFactor> (splitContainer.SplitterDistances.ElementAt (0));
  148. }
  149. [Fact, AutoInitShutdown]
  150. public void TestSplitView_Horizontal ()
  151. {
  152. var splitContainer = Get11By3SplitView (out var line);
  153. splitContainer.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
  154. splitContainer.Redraw (splitContainer.Bounds);
  155. string looksLike =
  156. @"
  157. 11111111111
  158. ───────────
  159. 22222222222";
  160. TestHelpers.AssertDriverContentsAre (looksLike, output);
  161. // Keyboard movement on splitter should have no effect if it is not focused
  162. line.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ()));
  163. splitContainer.SetNeedsDisplay ();
  164. splitContainer.Redraw (splitContainer.Bounds);
  165. TestHelpers.AssertDriverContentsAre (looksLike, output);
  166. }
  167. [Fact, AutoInitShutdown]
  168. public void TestSplitView_Vertical_View1MinSize_Absolute ()
  169. {
  170. var splitContainer = Get11By3SplitView (out var line);
  171. SetInputFocusLine (splitContainer);
  172. splitContainer.Tiles.ElementAt(0).MinSize = 6;
  173. // distance is too small (below 6)
  174. splitContainer.SetSplitterPos(0, 2);
  175. // Should bound the value to the minimum distance
  176. Assert.Equal (6, splitContainer.SplitterDistances.ElementAt (0));
  177. splitContainer.Redraw (splitContainer.Bounds);
  178. // so should ignore the 2 distance and stick to 6
  179. string looksLike =
  180. @"
  181. 111111│2222
  182. 111111◊2222
  183. │ ";
  184. TestHelpers.AssertDriverContentsAre (looksLike, output);
  185. // Keyboard movement on splitter should have no effect because it
  186. // would take us below the minimum splitter size
  187. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  188. splitContainer.SetNeedsDisplay ();
  189. splitContainer.Redraw (splitContainer.Bounds);
  190. TestHelpers.AssertDriverContentsAre (looksLike, output);
  191. // but we can continue to move the splitter right if we want
  192. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  193. splitContainer.SetNeedsDisplay ();
  194. splitContainer.Redraw (splitContainer.Bounds);
  195. looksLike =
  196. @"
  197. 1111111│222
  198. 1111111◊222
  199. │ ";
  200. TestHelpers.AssertDriverContentsAre (looksLike, output);
  201. }
  202. [Fact, AutoInitShutdown]
  203. public void TestSplitView_Vertical_View1MinSize_Absolute_WithBorder ()
  204. {
  205. var splitContainer = Get11By3SplitView (out var line,true);
  206. SetInputFocusLine (splitContainer);
  207. splitContainer.Tiles.ElementAt(0).MinSize = 5;
  208. // distance is too small (below 5)
  209. splitContainer.SetSplitterPos(0,2);
  210. // Should bound the value to the minimum distance
  211. Assert.Equal (6, splitContainer.SplitterDistances.ElementAt(0));
  212. splitContainer.Redraw (splitContainer.Bounds);
  213. // so should ignore the 2 distance and stick to 5
  214. string looksLike =
  215. @"
  216. ┌─────┬───┐
  217. │11111◊222│
  218. └─────┴───┘";
  219. TestHelpers.AssertDriverContentsAre (looksLike, output);
  220. // Keyboard movement on splitter should have no effect because it
  221. // would take us below the minimum splitter size
  222. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  223. splitContainer.SetNeedsDisplay ();
  224. splitContainer.Redraw (splitContainer.Bounds);
  225. TestHelpers.AssertDriverContentsAre (looksLike, output);
  226. // but we can continue to move the splitter right if we want
  227. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  228. splitContainer.SetNeedsDisplay ();
  229. splitContainer.Redraw (splitContainer.Bounds);
  230. looksLike =
  231. @"
  232. ┌──────┬──┐
  233. │111111◊22│
  234. └──────┴──┘";
  235. TestHelpers.AssertDriverContentsAre (looksLike, output);
  236. }
  237. [Fact, AutoInitShutdown]
  238. public void TestSplitView_Vertical_View2MinSize_Absolute ()
  239. {
  240. var splitContainer = Get11By3SplitView (out var line);
  241. SetInputFocusLine (splitContainer);
  242. splitContainer.Tiles.ElementAt(1).MinSize = 6;
  243. // distance leaves too little space for view2 (less than 6 would remain)
  244. splitContainer.SetSplitterPos(0,8);
  245. // Should bound the value to the minimum distance
  246. Assert.Equal (4, splitContainer.SplitterDistances.ElementAt(0));
  247. splitContainer.Redraw (splitContainer.Bounds);
  248. // so should ignore the 2 distance and stick to 6
  249. string looksLike =
  250. @"
  251. 1111│222222
  252. 1111◊222222
  253. │ ";
  254. TestHelpers.AssertDriverContentsAre (looksLike, output);
  255. // Keyboard movement on splitter should have no effect because it
  256. // would take us below the minimum splitter size
  257. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  258. splitContainer.SetNeedsDisplay ();
  259. splitContainer.Redraw (splitContainer.Bounds);
  260. TestHelpers.AssertDriverContentsAre (looksLike, output);
  261. // but we can continue to move the splitter left if we want
  262. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  263. splitContainer.SetNeedsDisplay ();
  264. splitContainer.Redraw (splitContainer.Bounds);
  265. looksLike =
  266. @"
  267. 111│2222222
  268. 111◊2222222
  269. │ ";
  270. TestHelpers.AssertDriverContentsAre (looksLike, output);
  271. }
  272. [Fact, AutoInitShutdown]
  273. public void TestSplitView_Vertical_View2MinSize_Absolute_WithBorder ()
  274. {
  275. var splitContainer = Get11By3SplitView (out var line, true);
  276. SetInputFocusLine (splitContainer);
  277. splitContainer.Tiles.ElementAt(1).MinSize = 5;
  278. // distance leaves too little space for view2 (less than 5 would remain)
  279. splitContainer.SetSplitterPos(0,8);
  280. // Should bound the value to the minimum distance
  281. Assert.Equal (4, splitContainer.SplitterDistances.ElementAt(0));
  282. splitContainer.Redraw (splitContainer.Bounds);
  283. // so should ignore the 2 distance and stick to 6
  284. string looksLike =
  285. @"
  286. ┌───┬─────┐
  287. │111◊22222│
  288. └───┴─────┘";
  289. TestHelpers.AssertDriverContentsAre (looksLike, output);
  290. // Keyboard movement on splitter should have no effect because it
  291. // would take us below the minimum splitter size
  292. line.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ()));
  293. splitContainer.SetNeedsDisplay ();
  294. splitContainer.Redraw (splitContainer.Bounds);
  295. TestHelpers.AssertDriverContentsAre (looksLike, output);
  296. // but we can continue to move the splitter left if we want
  297. line.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ()));
  298. splitContainer.SetNeedsDisplay ();
  299. splitContainer.Redraw (splitContainer.Bounds);
  300. looksLike =
  301. @"
  302. ┌──┬──────┐
  303. │11◊222222│
  304. └──┴──────┘";
  305. TestHelpers.AssertDriverContentsAre (looksLike, output);
  306. }
  307. [Fact, AutoInitShutdown]
  308. public void TestSplitView_Horizontal_Focused ()
  309. {
  310. var splitContainer = Get11By3SplitView (out var line);
  311. splitContainer.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
  312. SetInputFocusLine (splitContainer);
  313. splitContainer.Redraw (splitContainer.Bounds);
  314. string looksLike =
  315. @"
  316. 11111111111
  317. ─────◊─────
  318. 22222222222";
  319. TestHelpers.AssertDriverContentsAre (looksLike, output);
  320. // Now move splitter line down
  321. line.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ()));
  322. splitContainer.Redraw (splitContainer.Bounds);
  323. looksLike =
  324. @"
  325. 11111111111
  326. 11111111111
  327. ─────◊─────";
  328. TestHelpers.AssertDriverContentsAre (looksLike, output);
  329. // And 2 up
  330. line.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ()));
  331. line.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ()));
  332. splitContainer.Redraw (splitContainer.Bounds);
  333. looksLike =
  334. @"
  335. ─────◊─────
  336. 22222222222
  337. 22222222222";
  338. TestHelpers.AssertDriverContentsAre (looksLike, output);
  339. }
  340. [Fact, AutoInitShutdown]
  341. public void TestSplitView_Horizontal_View1MinSize_Absolute ()
  342. {
  343. var splitContainer = Get11By3SplitView (out var line);
  344. splitContainer.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
  345. SetInputFocusLine (splitContainer);
  346. splitContainer.Tiles.ElementAt(0).MinSize = 1;
  347. // 0 should not be allowed because it brings us below minimum size of View1
  348. splitContainer.SetSplitterPos(0,0);
  349. Assert.Equal ((Pos)1, splitContainer.SplitterDistances.ElementAt(0));
  350. splitContainer.Redraw (splitContainer.Bounds);
  351. string looksLike =
  352. @"
  353. 11111111111
  354. ─────◊─────
  355. 22222222222";
  356. TestHelpers.AssertDriverContentsAre (looksLike, output);
  357. // Now move splitter line down (allowed
  358. line.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ()));
  359. splitContainer.Redraw (splitContainer.Bounds);
  360. looksLike =
  361. @"
  362. 11111111111
  363. 11111111111
  364. ─────◊─────";
  365. TestHelpers.AssertDriverContentsAre (looksLike, output);
  366. // And up 2 (only 1 is allowed because of minimum size of 1 on view1)
  367. line.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ()));
  368. line.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ()));
  369. splitContainer.Redraw (splitContainer.Bounds);
  370. looksLike =
  371. @"
  372. 11111111111
  373. ─────◊─────
  374. 22222222222";
  375. TestHelpers.AssertDriverContentsAre (looksLike, output);
  376. }
  377. [Fact, AutoInitShutdown]
  378. public void TestSplitView_CannotSetSplitterPosToFuncEtc ()
  379. {
  380. var splitContainer = Get11By3SplitView ();
  381. var ex = Assert.Throws<ArgumentException> (() => splitContainer.SetSplitterPos(0,Pos.Right (splitContainer)));
  382. Assert.Equal ("Only Percent and Absolute values are supported for SplitterDistance property. Passed value was PosCombine", ex.Message);
  383. ex = Assert.Throws<ArgumentException> (() => splitContainer.SetSplitterPos(0,Pos.Function (() => 1)));
  384. Assert.Equal ("Only Percent and Absolute values are supported for SplitterDistance property. Passed value was PosFunc", ex.Message);
  385. // Also not allowed because this results in a PosCombine
  386. ex = Assert.Throws<ArgumentException> (() => splitContainer.SetSplitterPos(0, Pos.Percent (50) - 1));
  387. Assert.Equal ("Only Percent and Absolute values are supported for SplitterDistance property. Passed value was PosCombine", ex.Message);
  388. }
  389. [Fact,AutoInitShutdown]
  390. public void TestNestedContainer2LeftAnd1Right_RendersNicely()
  391. {
  392. var splitContainer = GetNestedContainer2Left1Right (false);
  393. Assert.Equal (20,splitContainer.Frame.Width);
  394. Assert.Equal (10, splitContainer.Tiles.ElementAt(0).View.Frame.Width);
  395. Assert.Equal (9, splitContainer.Tiles.ElementAt (1).View.Frame.Width);
  396. Assert.IsType<SplitView> (splitContainer.Tiles.ElementAt (0).View);
  397. var left = (SplitView)splitContainer.Tiles.ElementAt (0).View;
  398. Assert.Same (left.SuperView, splitContainer);
  399. Assert.Equal (10, left.Tiles.ElementAt(0).View.Frame.Width);
  400. Assert.Equal (5, left.Tiles.ElementAt (0).View.Frame.Height);
  401. Assert.Equal (10, left.Tiles.ElementAt (1).View.Frame.Width);
  402. Assert.Equal (4, left.Tiles.ElementAt (1).View.Frame.Height);
  403. Assert.Equal(2, left.Tiles.ElementAt (0).View.Subviews.Count);
  404. Assert.IsType<Label> (left.Tiles.ElementAt (0).View.Subviews [0]);
  405. Assert.IsType<Label> (left.Tiles.ElementAt (0).View.Subviews [1]);
  406. var onesTop = (Label)left.Tiles.ElementAt (0).View.Subviews [0];
  407. var onesBottom = (Label)left.Tiles.ElementAt (0).View.Subviews [1];
  408. Assert.Same (left.Tiles.ElementAt (0).View, onesTop.SuperView);
  409. Assert.Same (left.Tiles.ElementAt (0).View, onesBottom.SuperView);
  410. Assert.Equal (10, onesTop.Frame.Width);
  411. Assert.Equal (10, onesBottom.Frame.Width);
  412. splitContainer.Redraw (splitContainer.Bounds);
  413. string looksLike =
  414. @"
  415. 1111111111│222222222
  416. 1111111111│222222222
  417. ──────────┤
  418. │";
  419. TestHelpers.AssertDriverContentsAre (looksLike, output);
  420. }
  421. /// <summary>
  422. /// Creates a vertical orientation root container with left pane split into
  423. /// two (with horizontal splitter line).
  424. /// </summary>
  425. /// <param name="withBorder"></param>
  426. /// <returns></returns>
  427. private SplitView GetNestedContainer2Left1Right(bool withBorder)
  428. {
  429. var container = GetSplitView (20, 10,withBorder);
  430. Assert.True (container.TrySplitView1 (out var newContainer));
  431. newContainer.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
  432. newContainer.ColorScheme = new ColorScheme ();
  433. container.ColorScheme = new ColorScheme ();
  434. container.LayoutSubviews ();
  435. return container;
  436. }
  437. private LineView GetLine (SplitView splitContainer)
  438. {
  439. return splitContainer.Subviews.OfType<LineView> ().Single ();
  440. }
  441. private void SetInputFocusLine (SplitView splitContainer)
  442. {
  443. var line = GetLine (splitContainer);
  444. line.SetFocus ();
  445. Assert.True (line.HasFocus);
  446. }
  447. private SplitView Get11By3SplitView(out LineView line, bool withBorder = false)
  448. {
  449. var split = Get11By3SplitView (withBorder);
  450. line = GetLine (split);
  451. return split;
  452. }
  453. private SplitView Get11By3SplitView (bool withBorder = false)
  454. {
  455. return GetSplitView (11, 3, withBorder);
  456. }
  457. private SplitView GetSplitView (int width, int height, bool withBorder = false)
  458. {
  459. var container = new SplitView () {
  460. Width = width,
  461. Height = height,
  462. };
  463. container.IntegratedBorder = withBorder ? BorderStyle.Single : BorderStyle.None;
  464. container.Tiles.ElementAt(0).View.Add (new Label (new string ('1', 100)) { Width = Dim.Fill(), Height = 1, AutoSize = false});
  465. container.Tiles.ElementAt (0).View.Add (new Label (new string ('1', 100)) { Width = Dim.Fill (), Height = 1, AutoSize = false,Y = 1});
  466. container.Tiles.ElementAt (1).View.Add (new Label (new string ('2', 100)) { Width = Dim.Fill (), Height = 1, AutoSize = false });
  467. container.Tiles.ElementAt (1).View.Add (new Label (new string ('2', 100)) { Width = Dim.Fill (), Height = 1, AutoSize = false,Y = 1});
  468. container.Tiles.ElementAt (0).MinSize = 0;
  469. container.Tiles.ElementAt (1).MinSize = 0;
  470. Application.Top.Add (container);
  471. container.ColorScheme = new ColorScheme ();
  472. container.LayoutSubviews ();
  473. container.BeginInit ();
  474. container.EndInit ();
  475. return container;
  476. }
  477. }
  478. }