ListView.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // ListView.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Gui
  18. {
  19. /// <summary>
  20. /// Scrollable list %UI element.
  21. /// </summary>
  22. public unsafe partial class ListView : ScrollView
  23. {
  24. unsafe partial void OnListViewCreated ();
  25. [Preserve]
  26. public ListView (IntPtr handle) : base (handle)
  27. {
  28. OnListViewCreated ();
  29. }
  30. [Preserve]
  31. protected ListView (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnListViewCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int ListView_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (ListView_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr ListView_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (ListView_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int ListView_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(ListView));
  54. return new StringHash (ListView_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr ListView_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(ListView));
  61. return Marshal.PtrToStringAnsi (ListView_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public ListView () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr ListView_ListView (IntPtr context);
  69. [Preserve]
  70. public ListView (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(ListView));
  73. handle = ListView_ListView ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnListViewCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void ListView_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(ListView));
  85. ListView_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void ListView_OnKey (IntPtr handle, int key, int buttons, int qualifiers);
  89. /// <summary>
  90. /// React to a key press.
  91. /// </summary>
  92. public override void OnKey (int key, int buttons, int qualifiers)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. ListView_OnKey (handle, key, buttons, qualifiers);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void ListView_OnResize (IntPtr handle, ref Urho.IntVector2 newSize, ref Urho.IntVector2 delta);
  99. /// <summary>
  100. /// React to resize.
  101. /// </summary>
  102. public override void OnResize (Urho.IntVector2 newSize, Urho.IntVector2 delta)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. ListView_OnResize (handle, ref newSize, ref delta);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void ListView_AddItem (IntPtr handle, IntPtr item);
  109. /// <summary>
  110. /// Add item to the end of the list.
  111. /// </summary>
  112. public void AddItem (UIElement item)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. ListView_AddItem (handle, (object)item == null ? IntPtr.Zero : item.Handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void ListView_InsertItem (IntPtr handle, uint index, IntPtr item, IntPtr parentItem);
  119. /// <summary>
  120. ///
  121. /// Insert item at a specific index. In hierarchy mode, the optional parameter will be used to determine the child's indent level in respect to its parent.
  122. /// If index is greater than the total items then the new item is inserted at the end of the list.
  123. /// In hierarchy mode, if index is greater than the index of last children of the specified parent item then the new item is inserted next to the last children.
  124. /// And if the index is lesser than the index of the parent item itself then the new item is inserted before the first child item.
  125. /// </summary>
  126. public void InsertItem (uint index, UIElement item, UIElement parentItem = null)
  127. {
  128. Runtime.ValidateRefCounted (this);
  129. ListView_InsertItem (handle, index, (object)item == null ? IntPtr.Zero : item.Handle, (object)parentItem == null ? IntPtr.Zero : parentItem.Handle);
  130. }
  131. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  132. internal static extern void ListView_RemoveItem (IntPtr handle, IntPtr item, uint index);
  133. /// <summary>
  134. /// Remove specific item, starting search at the specified index if provided. In hierarchy mode will also remove any children.
  135. /// </summary>
  136. public void RemoveItem (UIElement item, uint index = 0)
  137. {
  138. Runtime.ValidateRefCounted (this);
  139. ListView_RemoveItem (handle, (object)item == null ? IntPtr.Zero : item.Handle, index);
  140. }
  141. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  142. internal static extern void ListView_RemoveItem0 (IntPtr handle, uint index);
  143. /// <summary>
  144. /// Remove item at index. In hierarchy mode will also remove any children.
  145. /// </summary>
  146. public void RemoveItem (uint index)
  147. {
  148. Runtime.ValidateRefCounted (this);
  149. ListView_RemoveItem0 (handle, index);
  150. }
  151. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  152. internal static extern void ListView_RemoveAllItems (IntPtr handle);
  153. /// <summary>
  154. /// Remove all items.
  155. /// </summary>
  156. public void RemoveAllItems ()
  157. {
  158. Runtime.ValidateRefCounted (this);
  159. ListView_RemoveAllItems (handle);
  160. }
  161. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  162. internal static extern void ListView_SetSelection (IntPtr handle, uint index);
  163. /// <summary>
  164. /// Set selection.
  165. /// </summary>
  166. private void SetSelection (uint index)
  167. {
  168. Runtime.ValidateRefCounted (this);
  169. ListView_SetSelection (handle, index);
  170. }
  171. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  172. internal static extern void ListView_AddSelection (IntPtr handle, uint index);
  173. /// <summary>
  174. /// Add item to the selection, multiselect mode only.
  175. /// </summary>
  176. public void AddSelection (uint index)
  177. {
  178. Runtime.ValidateRefCounted (this);
  179. ListView_AddSelection (handle, index);
  180. }
  181. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  182. internal static extern void ListView_RemoveSelection (IntPtr handle, uint index);
  183. /// <summary>
  184. /// Remove item from the selection.
  185. /// </summary>
  186. public void RemoveSelection (uint index)
  187. {
  188. Runtime.ValidateRefCounted (this);
  189. ListView_RemoveSelection (handle, index);
  190. }
  191. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  192. internal static extern void ListView_ToggleSelection (IntPtr handle, uint index);
  193. /// <summary>
  194. /// Toggle selection of an item.
  195. /// </summary>
  196. public void ToggleSelection (uint index)
  197. {
  198. Runtime.ValidateRefCounted (this);
  199. ListView_ToggleSelection (handle, index);
  200. }
  201. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  202. internal static extern void ListView_ChangeSelection (IntPtr handle, int delta, bool additive);
  203. /// <summary>
  204. /// Move selection by a delta and clamp at list ends. If additive (multiselect only), will add to the existing selection.
  205. /// </summary>
  206. public void ChangeSelection (int delta, bool additive = false)
  207. {
  208. Runtime.ValidateRefCounted (this);
  209. ListView_ChangeSelection (handle, delta, additive);
  210. }
  211. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  212. internal static extern void ListView_ClearSelection (IntPtr handle);
  213. /// <summary>
  214. /// Clear selection.
  215. /// </summary>
  216. public void ClearSelection ()
  217. {
  218. Runtime.ValidateRefCounted (this);
  219. ListView_ClearSelection (handle);
  220. }
  221. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  222. internal static extern void ListView_SetHighlightMode (IntPtr handle, HighlightMode mode);
  223. /// <summary>
  224. /// Set selected items' highlight mode.
  225. /// </summary>
  226. private void SetHighlightMode (HighlightMode mode)
  227. {
  228. Runtime.ValidateRefCounted (this);
  229. ListView_SetHighlightMode (handle, mode);
  230. }
  231. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  232. internal static extern void ListView_SetMultiselect (IntPtr handle, bool enable);
  233. /// <summary>
  234. /// Enable multiselect.
  235. /// </summary>
  236. private void SetMultiselect (bool enable)
  237. {
  238. Runtime.ValidateRefCounted (this);
  239. ListView_SetMultiselect (handle, enable);
  240. }
  241. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  242. internal static extern void ListView_SetHierarchyMode (IntPtr handle, bool enable);
  243. /// <summary>
  244. ///
  245. /// Enable hierarchy mode. Allows items to have parent-child relationship at different indent level and the ability to expand/collapse child items.
  246. /// All items in the list will be lost during mode change.
  247. /// </summary>
  248. private void SetHierarchyMode (bool enable)
  249. {
  250. Runtime.ValidateRefCounted (this);
  251. ListView_SetHierarchyMode (handle, enable);
  252. }
  253. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  254. internal static extern void ListView_SetBaseIndent (IntPtr handle, int baseIndent);
  255. /// <summary>
  256. /// Set base indent, i.e. the indent level of the ultimate parent item.
  257. /// </summary>
  258. private void SetBaseIndent (int baseIndent)
  259. {
  260. Runtime.ValidateRefCounted (this);
  261. ListView_SetBaseIndent (handle, baseIndent);
  262. }
  263. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  264. internal static extern void ListView_SetClearSelectionOnDefocus (IntPtr handle, bool enable);
  265. /// <summary>
  266. /// Enable clearing of selection on defocus.
  267. /// </summary>
  268. private void SetClearSelectionOnDefocus (bool enable)
  269. {
  270. Runtime.ValidateRefCounted (this);
  271. ListView_SetClearSelectionOnDefocus (handle, enable);
  272. }
  273. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  274. internal static extern void ListView_SetSelectOnClickEnd (IntPtr handle, bool enable);
  275. /// <summary>
  276. /// Enable reacting to click end instead of click start for item selection. Default false.
  277. /// </summary>
  278. private void SetSelectOnClickEnd (bool enable)
  279. {
  280. Runtime.ValidateRefCounted (this);
  281. ListView_SetSelectOnClickEnd (handle, enable);
  282. }
  283. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  284. internal static extern void ListView_Expand (IntPtr handle, uint index, bool enable, bool recursive);
  285. /// <summary>
  286. /// Expand item at index. Only has effect in hierarchy mode.
  287. /// </summary>
  288. public void Expand (uint index, bool enable, bool recursive = false)
  289. {
  290. Runtime.ValidateRefCounted (this);
  291. ListView_Expand (handle, index, enable, recursive);
  292. }
  293. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  294. internal static extern void ListView_ToggleExpand (IntPtr handle, uint index, bool recursive);
  295. /// <summary>
  296. /// Toggle item's expanded flag at index. Only has effect in hierarchy mode.
  297. /// </summary>
  298. public void ToggleExpand (uint index, bool recursive = false)
  299. {
  300. Runtime.ValidateRefCounted (this);
  301. ListView_ToggleExpand (handle, index, recursive);
  302. }
  303. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  304. internal static extern uint ListView_GetNumItems (IntPtr handle);
  305. /// <summary>
  306. /// Return number of items.
  307. /// </summary>
  308. private uint GetNumItems ()
  309. {
  310. Runtime.ValidateRefCounted (this);
  311. return ListView_GetNumItems (handle);
  312. }
  313. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  314. internal static extern IntPtr ListView_GetItem (IntPtr handle, uint index);
  315. /// <summary>
  316. /// Return item at index.
  317. /// </summary>
  318. public UIElement GetItem (uint index)
  319. {
  320. Runtime.ValidateRefCounted (this);
  321. return Runtime.LookupObject<UIElement> (ListView_GetItem (handle, index));
  322. }
  323. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  324. internal static extern uint ListView_FindItem (IntPtr handle, IntPtr item);
  325. /// <summary>
  326. /// Return index of item, or M_MAX_UNSIGNED If not found.
  327. /// </summary>
  328. public uint FindItem (UIElement item)
  329. {
  330. Runtime.ValidateRefCounted (this);
  331. return ListView_FindItem (handle, (object)item == null ? IntPtr.Zero : item.Handle);
  332. }
  333. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  334. internal static extern uint ListView_GetSelection (IntPtr handle);
  335. /// <summary>
  336. /// Return first selected index, or M_MAX_UNSIGNED if none selected.
  337. /// </summary>
  338. private uint GetSelection ()
  339. {
  340. Runtime.ValidateRefCounted (this);
  341. return ListView_GetSelection (handle);
  342. }
  343. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  344. internal static extern void ListView_CopySelectedItemsToClipboard (IntPtr handle);
  345. /// <summary>
  346. /// Copy selected items to system clipboard. Currently only applicable to Text items.
  347. /// </summary>
  348. public void CopySelectedItemsToClipboard ()
  349. {
  350. Runtime.ValidateRefCounted (this);
  351. ListView_CopySelectedItemsToClipboard (handle);
  352. }
  353. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  354. internal static extern IntPtr ListView_GetSelectedItem (IntPtr handle);
  355. /// <summary>
  356. /// Return first selected item, or null if none selected.
  357. /// </summary>
  358. private UIElement GetSelectedItem ()
  359. {
  360. Runtime.ValidateRefCounted (this);
  361. return Runtime.LookupObject<UIElement> (ListView_GetSelectedItem (handle));
  362. }
  363. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  364. internal static extern bool ListView_IsSelected (IntPtr handle, uint index);
  365. /// <summary>
  366. /// Return whether an item at index is seleccted.
  367. /// </summary>
  368. public bool IsSelected (uint index)
  369. {
  370. Runtime.ValidateRefCounted (this);
  371. return ListView_IsSelected (handle, index);
  372. }
  373. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  374. internal static extern bool ListView_IsExpanded (IntPtr handle, uint index);
  375. /// <summary>
  376. /// Return whether an item at index has its children expanded (in hierarchy mode only).
  377. /// </summary>
  378. public bool IsExpanded (uint index)
  379. {
  380. Runtime.ValidateRefCounted (this);
  381. return ListView_IsExpanded (handle, index);
  382. }
  383. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  384. internal static extern HighlightMode ListView_GetHighlightMode (IntPtr handle);
  385. /// <summary>
  386. /// Return highlight mode.
  387. /// </summary>
  388. private HighlightMode GetHighlightMode ()
  389. {
  390. Runtime.ValidateRefCounted (this);
  391. return ListView_GetHighlightMode (handle);
  392. }
  393. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  394. internal static extern bool ListView_GetMultiselect (IntPtr handle);
  395. /// <summary>
  396. /// Return whether multiselect enabled.
  397. /// </summary>
  398. private bool GetMultiselect ()
  399. {
  400. Runtime.ValidateRefCounted (this);
  401. return ListView_GetMultiselect (handle);
  402. }
  403. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  404. internal static extern bool ListView_GetClearSelectionOnDefocus (IntPtr handle);
  405. /// <summary>
  406. /// Return whether selection is cleared on defocus.
  407. /// </summary>
  408. private bool GetClearSelectionOnDefocus ()
  409. {
  410. Runtime.ValidateRefCounted (this);
  411. return ListView_GetClearSelectionOnDefocus (handle);
  412. }
  413. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  414. internal static extern bool ListView_GetSelectOnClickEnd (IntPtr handle);
  415. /// <summary>
  416. /// Return whether reacts to click end instead of click start for item selection.
  417. /// </summary>
  418. private bool GetSelectOnClickEnd ()
  419. {
  420. Runtime.ValidateRefCounted (this);
  421. return ListView_GetSelectOnClickEnd (handle);
  422. }
  423. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  424. internal static extern bool ListView_GetHierarchyMode (IntPtr handle);
  425. /// <summary>
  426. /// Return whether hierarchy mode enabled.
  427. /// </summary>
  428. private bool GetHierarchyMode ()
  429. {
  430. Runtime.ValidateRefCounted (this);
  431. return ListView_GetHierarchyMode (handle);
  432. }
  433. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  434. internal static extern int ListView_GetBaseIndent (IntPtr handle);
  435. /// <summary>
  436. /// Return base indent.
  437. /// </summary>
  438. private int GetBaseIndent ()
  439. {
  440. Runtime.ValidateRefCounted (this);
  441. return ListView_GetBaseIndent (handle);
  442. }
  443. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  444. internal static extern void ListView_EnsureItemVisibility (IntPtr handle, uint index);
  445. /// <summary>
  446. /// Ensure full visibility of the item.
  447. /// </summary>
  448. public void EnsureItemVisibility (uint index)
  449. {
  450. Runtime.ValidateRefCounted (this);
  451. ListView_EnsureItemVisibility (handle, index);
  452. }
  453. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  454. internal static extern void ListView_EnsureItemVisibility1 (IntPtr handle, IntPtr item);
  455. /// <summary>
  456. /// Ensure full visibility of the item.
  457. /// </summary>
  458. public void EnsureItemVisibility (UIElement item)
  459. {
  460. Runtime.ValidateRefCounted (this);
  461. ListView_EnsureItemVisibility1 (handle, (object)item == null ? IntPtr.Zero : item.Handle);
  462. }
  463. public override StringHash Type {
  464. get {
  465. return UrhoGetType ();
  466. }
  467. }
  468. public override string TypeName {
  469. get {
  470. return GetTypeName ();
  471. }
  472. }
  473. [Preserve]
  474. public new static StringHash TypeStatic {
  475. get {
  476. return GetTypeStatic ();
  477. }
  478. }
  479. public new static string TypeNameStatic {
  480. get {
  481. return GetTypeNameStatic ();
  482. }
  483. }
  484. /// <summary>
  485. /// Return first selected index, or M_MAX_UNSIGNED if none selected.
  486. /// Or
  487. /// Set selection.
  488. /// </summary>
  489. public uint Selection {
  490. get {
  491. return GetSelection ();
  492. }
  493. set {
  494. SetSelection (value);
  495. }
  496. }
  497. /// <summary>
  498. /// Return highlight mode.
  499. /// Or
  500. /// Set selected items' highlight mode.
  501. /// </summary>
  502. public HighlightMode HighlightMode {
  503. get {
  504. return GetHighlightMode ();
  505. }
  506. set {
  507. SetHighlightMode (value);
  508. }
  509. }
  510. /// <summary>
  511. /// Return whether multiselect enabled.
  512. /// Or
  513. /// Enable multiselect.
  514. /// </summary>
  515. public bool Multiselect {
  516. get {
  517. return GetMultiselect ();
  518. }
  519. set {
  520. SetMultiselect (value);
  521. }
  522. }
  523. /// <summary>
  524. /// Return whether hierarchy mode enabled.
  525. /// Or
  526. ///
  527. /// Enable hierarchy mode. Allows items to have parent-child relationship at different indent level and the ability to expand/collapse child items.
  528. /// All items in the list will be lost during mode change.
  529. /// </summary>
  530. public bool HierarchyMode {
  531. get {
  532. return GetHierarchyMode ();
  533. }
  534. set {
  535. SetHierarchyMode (value);
  536. }
  537. }
  538. /// <summary>
  539. /// Return base indent.
  540. /// Or
  541. /// Set base indent, i.e. the indent level of the ultimate parent item.
  542. /// </summary>
  543. public int BaseIndent {
  544. get {
  545. return GetBaseIndent ();
  546. }
  547. set {
  548. SetBaseIndent (value);
  549. }
  550. }
  551. /// <summary>
  552. /// Return whether selection is cleared on defocus.
  553. /// Or
  554. /// Enable clearing of selection on defocus.
  555. /// </summary>
  556. public bool ClearSelectionOnDefocus {
  557. get {
  558. return GetClearSelectionOnDefocus ();
  559. }
  560. set {
  561. SetClearSelectionOnDefocus (value);
  562. }
  563. }
  564. /// <summary>
  565. /// Return whether reacts to click end instead of click start for item selection.
  566. /// Or
  567. /// Enable reacting to click end instead of click start for item selection. Default false.
  568. /// </summary>
  569. public bool SelectOnClickEnd {
  570. get {
  571. return GetSelectOnClickEnd ();
  572. }
  573. set {
  574. SetSelectOnClickEnd (value);
  575. }
  576. }
  577. /// <summary>
  578. /// Return number of items.
  579. /// </summary>
  580. public uint NumItems {
  581. get {
  582. return GetNumItems ();
  583. }
  584. }
  585. /// <summary>
  586. /// Return first selected item, or null if none selected.
  587. /// </summary>
  588. public UIElement SelectedItem {
  589. get {
  590. return GetSelectedItem ();
  591. }
  592. }
  593. }
  594. }