avalonia-controls.xml 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Avalonia UI Controls Definition for UI Layout Definition Format -->
  3. <patterns xmlns="ui-layout-patterns">
  4. <!-- Base Avalonia Controls -->
  5. <!-- Content Controls -->
  6. <control name="AvaloniaButton" type="action" category="avalonia-specific" inherits="Button">
  7. <constraints>
  8. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,WrapPanel,UniformGrid</allowed-parents>
  9. <allowed-children>any-content</allowed-children>
  10. <container>true</container>
  11. </constraints>
  12. <attributes>
  13. <attribute name="click-mode" type="enum" values="Release,Press,Hover" default="Release" />
  14. <attribute name="is-default" type="bool" default="false" />
  15. <attribute name="is-cancel" type="bool" default="false" />
  16. <attribute name="hotkey" type="string" default="" />
  17. <attribute name="command" type="string" default="" />
  18. <attribute name="command-parameter" type="object" default="null" />
  19. </attributes>
  20. <behavior>
  21. <event name="click" required="true" />
  22. <event name="command-changed" />
  23. </behavior>
  24. </control>
  25. <control name="RepeatButton" type="action" category="avalonia-specific">
  26. <constraints>
  27. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  28. <allowed-children>any-content</allowed-children>
  29. <container>true</container>
  30. </constraints>
  31. <attributes>
  32. <attribute name="delay" type="int" default="500" min="0" max="5000" />
  33. <attribute name="interval" type="int" default="33" min="1" max="1000" />
  34. </attributes>
  35. <behavior>
  36. <event name="click" required="true" />
  37. </behavior>
  38. </control>
  39. <!-- Layout Panels -->
  40. <control name="StackPanel" type="container" category="avalonia-layout">
  41. <constraints>
  42. <allowed-parents>Panel,Grid,DockPanel,Canvas,ScrollViewer,Border</allowed-parents>
  43. <allowed-children>any-control</allowed-children>
  44. <container>true</container>
  45. </constraints>
  46. <attributes>
  47. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Vertical" />
  48. <attribute name="spacing" type="double" default="0" min="0" max="100" />
  49. </attributes>
  50. </control>
  51. <control name="Grid" type="container" category="avalonia-layout">
  52. <constraints>
  53. <allowed-parents>Panel,StackPanel,DockPanel,Canvas,ScrollViewer,Border</allowed-parents>
  54. <allowed-children>any-control</allowed-children>
  55. <container>true</container>
  56. <requires-structure>grid-definitions</requires-structure>
  57. </constraints>
  58. <attributes>
  59. <attribute name="show-grid-lines" type="bool" default="false" />
  60. </attributes>
  61. <structure>
  62. <grid-definitions>
  63. <row-definitions>
  64. <row-definition height="*" min-height="0" max-height="Infinity" />
  65. </row-definitions>
  66. <column-definitions>
  67. <column-definition width="*" min-width="0" max-width="Infinity" />
  68. </column-definitions>
  69. </grid-definitions>
  70. <children>
  71. <child grid-row="0" grid-column="0" grid-row-span="1" grid-column-span="1" />
  72. </children>
  73. </structure>
  74. </control>
  75. <control name="DockPanel" type="container" category="avalonia-layout">
  76. <constraints>
  77. <allowed-parents>Panel,StackPanel,Grid,Canvas,ScrollViewer,Border</allowed-parents>
  78. <allowed-children>any-control</allowed-children>
  79. <container>true</container>
  80. </constraints>
  81. <attributes>
  82. <attribute name="last-child-fill" type="bool" default="true" />
  83. </attributes>
  84. <structure>
  85. <children>
  86. <child dock="Left,Top,Right,Bottom,None" />
  87. </children>
  88. </structure>
  89. </control>
  90. <control name="WrapPanel" type="container" category="avalonia-layout">
  91. <constraints>
  92. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  93. <allowed-children>any-control</allowed-children>
  94. <container>true</container>
  95. </constraints>
  96. <attributes>
  97. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Horizontal" />
  98. <attribute name="item-width" type="double" default="NaN" min="0" />
  99. <attribute name="item-height" type="double" default="NaN" min="0" />
  100. </attributes>
  101. </control>
  102. <control name="Canvas" type="container" category="avalonia-layout">
  103. <constraints>
  104. <allowed-parents>Panel,StackPanel,Grid,DockPanel,ScrollViewer</allowed-parents>
  105. <allowed-children>any-control</allowed-children>
  106. <container>true</container>
  107. </constraints>
  108. <attributes>
  109. <attribute name="background" type="brush" default="Transparent" />
  110. </attributes>
  111. <structure>
  112. <children>
  113. <child canvas-left="0" canvas-top="0" canvas-right="NaN" canvas-bottom="NaN" />
  114. </children>
  115. </structure>
  116. </control>
  117. <control name="UniformGrid" type="container" category="avalonia-layout">
  118. <constraints>
  119. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  120. <allowed-children>any-control</allowed-children>
  121. <container>true</container>
  122. </constraints>
  123. <attributes>
  124. <attribute name="rows" type="int" default="0" min="0" max="100" />
  125. <attribute name="columns" type="int" default="0" min="0" max="100" />
  126. <attribute name="first-column" type="int" default="0" min="0" />
  127. </attributes>
  128. </control>
  129. <!-- Input Controls -->
  130. <control name="AvaloniaTextBox" type="input" category="avalonia-input" inherits="TextBox">
  131. <constraints>
  132. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  133. <allowed-children>none</allowed-children>
  134. <container>false</container>
  135. </constraints>
  136. <attributes>
  137. <attribute name="accepts-return" type="bool" default="false" />
  138. <attribute name="accepts-tab" type="bool" default="false" />
  139. <attribute name="caret-index" type="int" default="0" min="0" />
  140. <attribute name="selection-start" type="int" default="0" min="0" />
  141. <attribute name="selection-end" type="int" default="0" min="0" />
  142. <attribute name="text-wrapping" type="enum" values="NoWrap,Wrap" default="NoWrap" />
  143. <attribute name="watermark" type="string" default="" />
  144. <attribute name="password-char" type="char" default="" />
  145. <attribute name="reveal-password" type="bool" default="false" />
  146. <attribute name="use-floating-watermark" type="bool" default="false" />
  147. </attributes>
  148. <behavior>
  149. <event name="text-changed" />
  150. <event name="text-changing" />
  151. <event name="selection-changed" />
  152. <event name="copy" />
  153. <event name="cut" />
  154. <event name="paste" />
  155. </behavior>
  156. </control>
  157. <control name="NumericUpDown" type="input" category="avalonia-input">
  158. <constraints>
  159. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  160. <allowed-children>none</allowed-children>
  161. <container>false</container>
  162. </constraints>
  163. <attributes>
  164. <attribute name="value" type="double" default="0" />
  165. <attribute name="minimum" type="double" default="0" />
  166. <attribute name="maximum" type="double" default="100" />
  167. <attribute name="increment" type="double" default="1" />
  168. <attribute name="format-string" type="string" default="F0" />
  169. <attribute name="text" type="string" default="" />
  170. <attribute name="watermark" type="string" default="" />
  171. <attribute name="show-button-spinner" type="bool" default="true" />
  172. <attribute name="allow-spin" type="bool" default="true" />
  173. <attribute name="button-spinner-location" type="enum" values="Right,Left" default="Right" />
  174. </attributes>
  175. <behavior>
  176. <event name="value-changed" />
  177. <event name="spin" />
  178. </behavior>
  179. </control>
  180. <control name="AvaloniaComboBox" type="input" category="avalonia-input" inherits="ComboBox">
  181. <constraints>
  182. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  183. <allowed-children>ComboBoxItem</allowed-children>
  184. <container>true</container>
  185. </constraints>
  186. <attributes>
  187. <attribute name="is-dropdown-open" type="bool" default="false" />
  188. <attribute name="max-drop-down-height" type="double" default="200" min="0" />
  189. <attribute name="placeholder-text" type="string" default="" />
  190. <attribute name="placeholder-foreground" type="brush" default="Gray" />
  191. </attributes>
  192. <behavior>
  193. <event name="dropdown-opened" />
  194. <event name="dropdown-closed" />
  195. </behavior>
  196. <structure>
  197. <items>
  198. <ComboBoxItem content="" is-selected="false" />
  199. </items>
  200. </structure>
  201. </control>
  202. <control name="AutoCompleteBox" type="input" category="avalonia-input">
  203. <constraints>
  204. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  205. <allowed-children>none</allowed-children>
  206. <container>false</container>
  207. </constraints>
  208. <attributes>
  209. <attribute name="text" type="string" default="" />
  210. <attribute name="search-text" type="string" default="" />
  211. <attribute name="watermark" type="string" default="" />
  212. <attribute name="minimum-prefix-length" type="int" default="1" min="0" max="10" />
  213. <attribute name="minimum-populate-delay" type="int" default="0" min="0" max="5000" />
  214. <attribute name="maximum-drop-down-height" type="double" default="600" min="0" />
  215. <attribute name="is-drop-down-open" type="bool" default="false" />
  216. <attribute name="filter-mode" type="enum" values="None,StartsWith,StartsWithCaseSensitive,StartsWithOrdinal,StartsWithOrdinalCaseSensitive,Contains,ContainsCaseSensitive,ContainsOrdinal,ContainsOrdinalCaseSensitive,Equals,EqualsCaseSensitive,EqualsOrdinal,EqualsOrdinalCaseSensitive,Custom" default="StartsWith" />
  217. </attributes>
  218. <behavior>
  219. <event name="text-changed" />
  220. <event name="populating" />
  221. <event name="populated" />
  222. <event name="dropdown-opening" />
  223. <event name="dropdown-opened" />
  224. <event name="dropdown-closing" />
  225. <event name="dropdown-closed" />
  226. <event name="selection-changed" />
  227. </behavior>
  228. </control>
  229. <control name="CheckBox" type="input" category="avalonia-input">
  230. <constraints>
  231. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  232. <allowed-children>any-content</allowed-children>
  233. <container>true</container>
  234. </constraints>
  235. <attributes>
  236. <attribute name="is-checked" type="bool" default="false" />
  237. <attribute name="is-three-state" type="bool" default="false" />
  238. </attributes>
  239. <behavior>
  240. <event name="checked" />
  241. <event name="unchecked" />
  242. <event name="indeterminate" />
  243. </behavior>
  244. </control>
  245. <control name="RadioButton" type="input" category="avalonia-input">
  246. <constraints>
  247. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  248. <allowed-children>any-content</allowed-children>
  249. <container>true</container>
  250. </constraints>
  251. <attributes>
  252. <attribute name="is-checked" type="bool" default="false" />
  253. <attribute name="group-name" type="string" default="" />
  254. </attributes>
  255. <behavior>
  256. <event name="checked" />
  257. <event name="unchecked" />
  258. </behavior>
  259. </control>
  260. <control name="Slider" type="input" category="avalonia-input">
  261. <constraints>
  262. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  263. <allowed-children>none</allowed-children>
  264. <container>false</container>
  265. </constraints>
  266. <attributes>
  267. <attribute name="value" type="double" default="0" />
  268. <attribute name="minimum" type="double" default="0" />
  269. <attribute name="maximum" type="double" default="10" />
  270. <attribute name="small-change" type="double" default="0.1" />
  271. <attribute name="large-change" type="double" default="1" />
  272. <attribute name="tick-frequency" type="double" default="0" />
  273. <attribute name="tick-placement" type="enum" values="None,TopLeft,BottomRight,Both" default="None" />
  274. <attribute name="is-snap-to-tick-enabled" type="bool" default="false" />
  275. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Horizontal" />
  276. </attributes>
  277. <behavior>
  278. <event name="value-changed" />
  279. </behavior>
  280. </control>
  281. <control name="CalendarDatePicker" type="input" category="avalonia-input">
  282. <constraints>
  283. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  284. <allowed-children>none</allowed-children>
  285. <container>false</container>
  286. </constraints>
  287. <attributes>
  288. <attribute name="selected-date" type="date" default="null" />
  289. <attribute name="display-date" type="date" default="today" />
  290. <attribute name="first-day-of-week" type="enum" values="Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" default="Sunday" />
  291. <attribute name="is-drop-down-open" type="bool" default="false" />
  292. <attribute name="placeholder-text" type="string" default="" />
  293. <attribute name="watermark" type="string" default="" />
  294. </attributes>
  295. <behavior>
  296. <event name="selected-date-changed" />
  297. <event name="calendar-opened" />
  298. <event name="calendar-closed" />
  299. <event name="date-validation-error" />
  300. </behavior>
  301. </control>
  302. <control name="TimePicker" type="input" category="avalonia-input">
  303. <constraints>
  304. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  305. <allowed-children>none</allowed-children>
  306. <container>false</container>
  307. </constraints>
  308. <attributes>
  309. <attribute name="selected-time" type="timespan" default="null" />
  310. <attribute name="minute-increment" type="int" default="1" min="1" max="30" />
  311. <attribute name="clock-identifier" type="string" default="12HourClock" />
  312. </attributes>
  313. <behavior>
  314. <event name="selected-time-changed" />
  315. </behavior>
  316. </control>
  317. <!-- Display Controls -->
  318. <control name="AvaloniaLabel" type="display" category="avalonia-display" inherits="Label">
  319. <constraints>
  320. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  321. <allowed-children>any-content</allowed-children>
  322. <container>true</container>
  323. </constraints>
  324. <attributes>
  325. <attribute name="target" type="string" default="" />
  326. </attributes>
  327. </control>
  328. <control name="TextBlock" type="display" category="avalonia-display">
  329. <constraints>
  330. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,ScrollViewer</allowed-parents>
  331. <allowed-children>Inline</allowed-children>
  332. <container>true</container>
  333. </constraints>
  334. <attributes>
  335. <attribute name="text" type="string" default="" />
  336. <attribute name="font-family" type="string" default="Default" />
  337. <attribute name="font-size" type="double" default="12" min="1" max="100" />
  338. <attribute name="font-weight" type="enum" values="Thin,ExtraLight,Light,Normal,Medium,SemiBold,Bold,ExtraBold,Black,ExtraBlack" default="Normal" />
  339. <attribute name="font-style" type="enum" values="Normal,Italic,Oblique" default="Normal" />
  340. <attribute name="text-alignment" type="enum" values="Left,Center,Right,Justify" default="Left" />
  341. <attribute name="text-wrapping" type="enum" values="NoWrap,Wrap" default="NoWrap" />
  342. <attribute name="text-trimming" type="enum" values="None,CharacterEllipsis,WordEllipsis" default="None" />
  343. <attribute name="text-decoration" type="enum" values="None,Underline,Strikethrough,Baseline,OverLine" default="None" />
  344. <attribute name="line-height" type="double" default="NaN" min="0" />
  345. <attribute name="max-lines" type="int" default="0" min="0" />
  346. </attributes>
  347. </control>
  348. <control name="Image" type="display" category="avalonia-display">
  349. <constraints>
  350. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  351. <allowed-children>none</allowed-children>
  352. <container>false</container>
  353. </constraints>
  354. <attributes>
  355. <attribute name="source" type="string" default="" />
  356. <attribute name="stretch" type="enum" values="None,Fill,Uniform,UniformToFill" default="Uniform" />
  357. <attribute name="stretch-direction" type="enum" values="UpOnly,DownOnly,Both" default="Both" />
  358. </attributes>
  359. </control>
  360. <control name="ProgressBar" type="display" category="avalonia-display">
  361. <constraints>
  362. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  363. <allowed-children>none</allowed-children>
  364. <container>false</container>
  365. </constraints>
  366. <attributes>
  367. <attribute name="value" type="double" default="0" />
  368. <attribute name="minimum" type="double" default="0" />
  369. <attribute name="maximum" type="double" default="100" />
  370. <attribute name="is-indeterminate" type="bool" default="false" />
  371. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Horizontal" />
  372. <attribute name="show-progress-text" type="bool" default="false" />
  373. </attributes>
  374. </control>
  375. <!-- Data Controls -->
  376. <control name="AvaloniaListView" type="data" category="avalonia-data" inherits="ListView">
  377. <constraints>
  378. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,ScrollViewer</allowed-parents>
  379. <allowed-children>ListViewItem</allowed-children>
  380. <container>true</container>
  381. </constraints>
  382. <attributes>
  383. <attribute name="selection-mode" type="enum" values="Single,Multiple,Extended,Toggle" default="Single" />
  384. </attributes>
  385. <structure>
  386. <view>
  387. <grid-view>
  388. <columns>
  389. <grid-view-column header="" display-member-binding="" width="auto" />
  390. </columns>
  391. </grid-view>
  392. </view>
  393. </structure>
  394. </control>
  395. <control name="DataGrid" type="data" category="avalonia-data">
  396. <constraints>
  397. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  398. <allowed-children>DataGridColumn</allowed-children>
  399. <container>true</container>
  400. <requires-structure>columns</requires-structure>
  401. </constraints>
  402. <attributes>
  403. <attribute name="items-source" type="object" default="null" />
  404. <attribute name="selected-item" type="object" default="null" />
  405. <attribute name="selected-index" type="int" default="-1" />
  406. <attribute name="can-user-resize-columns" type="bool" default="true" />
  407. <attribute name="can-user-sort-columns" type="bool" default="true" />
  408. <attribute name="can-user-reorder-columns" type="bool" default="true" />
  409. <attribute name="row-background" type="brush" default="Transparent" />
  410. <attribute name="alternating-row-background" type="brush" default="Transparent" />
  411. <attribute name="selection-mode" type="enum" values="Single,Extended" default="Extended" />
  412. <attribute name="grid-lines-visibility" type="enum" values="None,Horizontal,Vertical,All" default="All" />
  413. <attribute name="headers-visibility" type="enum" values="None,Column,Row,All" default="Column" />
  414. <attribute name="auto-generate-columns" type="bool" default="true" />
  415. <attribute name="is-read-only" type="bool" default="false" />
  416. </attributes>
  417. <behavior>
  418. <event name="selection-changed" />
  419. <event name="current-cell-changed" />
  420. <event name="row-edit-ending" />
  421. <event name="row-edit-ended" />
  422. <event name="cell-edit-ending" />
  423. <event name="cell-edit-ended" />
  424. <event name="begin-edit" />
  425. <event name="prepare-cell-for-edit" />
  426. <event name="column-reordering" />
  427. <event name="column-reordered" />
  428. <event name="sorting" />
  429. </behavior>
  430. <structure>
  431. <columns min-count="0" max-count="50">
  432. <DataGridTextColumn header="" binding="" width="*" is-read-only="false" />
  433. <DataGridCheckBoxColumn header="" binding="" width="auto" is-read-only="false" />
  434. <DataGridComboBoxColumn header="" binding="" width="*" is-read-only="false" />
  435. <DataGridTemplateColumn header="" width="*" is-read-only="false" />
  436. </columns>
  437. </structure>
  438. </control>
  439. <control name="AvaloniaTreeView" type="data" category="avalonia-data" inherits="TreeView">
  440. <constraints>
  441. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  442. <allowed-children>TreeViewItem</allowed-children>
  443. <container>true</container>
  444. </constraints>
  445. <attributes>
  446. <attribute name="selected-item" type="object" default="null" />
  447. <attribute name="auto-scroll-to-selected-item" type="bool" default="true" />
  448. </attributes>
  449. <behavior>
  450. <event name="selection-changed" />
  451. </behavior>
  452. <structure>
  453. <items>
  454. <TreeViewItem header="" is-expanded="false" is-selected="false">
  455. <items>
  456. <!-- Recursive TreeViewItem structure -->
  457. </items>
  458. </TreeViewItem>
  459. </items>
  460. </structure>
  461. </control>
  462. <control name="ListBox" type="data" category="avalonia-data">
  463. <constraints>
  464. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  465. <allowed-children>ListBoxItem</allowed-children>
  466. <container>true</container>
  467. </constraints>
  468. <attributes>
  469. <attribute name="selected-item" type="object" default="null" />
  470. <attribute name="selected-index" type="int" default="-1" />
  471. <attribute name="selection-mode" type="enum" values="Single,Multiple,Extended,Toggle" default="Single" />
  472. </attributes>
  473. <behavior>
  474. <event name="selection-changed" />
  475. </behavior>
  476. <structure>
  477. <items>
  478. <ListBoxItem content="" is-selected="false" />
  479. </items>
  480. </structure>
  481. </control>
  482. <!-- Container and Decoration Controls -->
  483. <control name="Border" type="container" category="avalonia-decoration">
  484. <constraints>
  485. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  486. <allowed-children>single-child</allowed-children>
  487. <container>true</container>
  488. <max-children>1</max-children>
  489. </constraints>
  490. <attributes>
  491. <attribute name="border-brush" type="brush" default="Black" />
  492. <attribute name="border-thickness" type="thickness" default="0" />
  493. <attribute name="corner-radius" type="corner-radius" default="0" />
  494. <attribute name="background" type="brush" default="Transparent" />
  495. <attribute name="padding" type="thickness" default="0" />
  496. </attributes>
  497. </control>
  498. <control name="ScrollViewer" type="container" category="avalonia-container">
  499. <constraints>
  500. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,Border</allowed-parents>
  501. <allowed-children>single-child</allowed-children>
  502. <container>true</container>
  503. <max-children>1</max-children>
  504. </constraints>
  505. <attributes>
  506. <attribute name="horizontal-scroll-bar-visibility" type="enum" values="Disabled,Auto,Hidden,Visible" default="Disabled" />
  507. <attribute name="vertical-scroll-bar-visibility" type="enum" values="Disabled,Auto,Hidden,Visible" default="Auto" />
  508. <attribute name="zoom-mode" type="enum" values="Disabled,Enabled" default="Disabled" />
  509. <attribute name="horizontal-snap-points-type" type="enum" values="None,Optional,Mandatory,OptionalSingle,MandatorySingle" default="None" />
  510. <attribute name="vertical-snap-points-type" type="enum" values="None,Optional,Mandatory,OptionalSingle,MandatorySingle" default="None" />
  511. <attribute name="is-scroll-chaining-enabled" type="bool" default="true" />
  512. </attributes>
  513. <behavior>
  514. <event name="scroll-changed" />
  515. </behavior>
  516. </control>
  517. <control name="Expander" type="container" category="avalonia-container">
  518. <constraints>
  519. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  520. <allowed-children>single-child</allowed-children>
  521. <container>true</container>
  522. <max-children>1</max-children>
  523. </constraints>
  524. <attributes>
  525. <attribute name="is-expanded" type="bool" default="false" />
  526. <attribute name="expand-direction" type="enum" values="Down,Up,Left,Right" default="Down" />
  527. <attribute name="header" type="object" default="null" />
  528. </attributes>
  529. <behavior>
  530. <event name="expanded" />
  531. <event name="collapsed" />
  532. </behavior>
  533. </control>
  534. <control name="TabControl" type="container" category="avalonia-container">
  535. <constraints>
  536. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  537. <allowed-children>TabItem</allowed-children>
  538. <container>true</container>
  539. <requires-structure>tabs</requires-structure>
  540. </constraints>
  541. <attributes>
  542. <attribute name="selected-index" type="int" default="0" min="0" />
  543. <attribute name="selected-item" type="object" default="null" />
  544. <attribute name="tab-strip-placement" type="enum" values="Top,Bottom,Left,Right" default="Top" />
  545. </attributes>
  546. <behavior>
  547. <event name="selection-changed" />
  548. </behavior>
  549. <structure>
  550. <tabs min-count="1" max-count="20">
  551. <TabItem header="" is-selected="false">
  552. <!-- Tab content -->
  553. </TabItem>
  554. </tabs>
  555. </structure>
  556. </control>
  557. <control name="SplitView" type="container" category="avalonia-container">
  558. <constraints>
  559. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  560. <allowed-children>pane-content</allowed-children>
  561. <container>true</container>
  562. <max-children>2</max-children>
  563. </constraints>
  564. <attributes>
  565. <attribute name="is-pane-open" type="bool" default="false" />
  566. <attribute name="display-mode" type="enum" values="Overlay,Inline,CompactOverlay,CompactInline" default="Overlay" />
  567. <attribute name="open-pane-length" type="double" default="320" min="0" />
  568. <attribute name="compact-pane-length" type="double" default="48" min="0" />
  569. <attribute name="pane-placement" type="enum" values="Left,Right" default="Left" />
  570. </attributes>
  571. <behavior>
  572. <event name="pane-opened" />
  573. <event name="pane-closed" />
  574. </behavior>
  575. <structure>
  576. <pane>
  577. <!-- Pane content -->
  578. </pane>
  579. <content>
  580. <!-- Main content -->
  581. </content>
  582. </structure>
  583. </control>
  584. <!-- Specialized Controls -->
  585. <control name="MenuBar" type="navigation" category="avalonia-navigation">
  586. <constraints>
  587. <allowed-parents>Panel,StackPanel,Grid,DockPanel</allowed-parents>
  588. <allowed-children>NativeMenuItem</allowed-children>
  589. <container>true</container>
  590. <requires-structure>menu-items</requires-structure>
  591. </constraints>
  592. <structure>
  593. <menu-items min-count="1" max-count="20">
  594. <NativeMenuItem header="" command="" input-gesture="">
  595. <menu-items>
  596. <!-- Nested menu items -->
  597. </menu-items>
  598. </NativeMenuItem>
  599. </menu-items>
  600. </structure>
  601. </control>
  602. <control name="ContextMenu" type="navigation" category="avalonia-navigation">
  603. <constraints>
  604. <allowed-parents>any-control</allowed-parents>
  605. <allowed-children>MenuItem</allowed-children>
  606. <container>true</container>
  607. <requires-structure>menu-items</requires-structure>
  608. </constraints>
  609. <attributes>
  610. <attribute name="placement-mode" type="enum" values="Bottom,Right,Mouse,Relative,BottomEdgeAlignedLeft,BottomEdgeAlignedRight,TopEdgeAlignedLeft,TopEdgeAlignedRight,LeftEdgeAlignedTop,LeftEdgeAlignedBottom,RightEdgeAlignedTop,RightEdgeAlignedBottom" default="Mouse" />
  611. <attribute name="placement-target" type="object" default="null" />
  612. </attributes>
  613. <behavior>
  614. <event name="opened" />
  615. <event name="closed" />
  616. </behavior>
  617. <structure>
  618. <menu-items min-count="1" max-count="50">
  619. <MenuItem header="" command="" input-gesture="" is-checkable="false" is-checked="false">
  620. <menu-items>
  621. <!-- Nested menu items -->
  622. </menu-items>
  623. </MenuItem>
  624. </menu-items>
  625. </structure>
  626. </control>
  627. <control name="ToolTip" type="display" category="avalonia-decoration">
  628. <constraints>
  629. <allowed-parents>any-control</allowed-parents>
  630. <allowed-children>any-content</allowed-children>
  631. <container>true</container>
  632. <max-children>1</max-children>
  633. </constraints>
  634. <attributes>
  635. <attribute name="tip" type="object" default="null" />
  636. <attribute name="placement" type="enum" values="Top,Bottom,Left,Right,Pointer,TopEdgeAlignedLeft,TopEdgeAlignedRight,BottomEdgeAlignedLeft,BottomEdgeAlignedRight,LeftEdgeAlignedTop,LeftEdgeAlignedBottom,RightEdgeAlignedTop,RightEdgeAlignedBottom" default="Top" />
  637. <attribute name="horizontal-offset" type="double" default="0" />
  638. <attribute name="vertical-offset" type="double" default="0" />
  639. <attribute name="show-delay" type="int" default="400" min="0" max="5000" />
  640. <attribute name="show-on-disabled" type="bool" default="true" />
  641. </attributes>
  642. <behavior>
  643. <event name="tip-opened" />
  644. <event name="tip-closed" />
  645. </behavior>
  646. </control>
  647. <control name="FlyoutBase" type="container" category="avalonia-popup">
  648. <constraints>
  649. <allowed-parents>any-control</allowed-parents>
  650. <allowed-children>any-content</allowed-children>
  651. <container>true</container>
  652. </constraints>
  653. <attributes>
  654. <attribute name="placement" type="enum" values="Top,Bottom,Left,Right,TopEdgeAlignedLeft,TopEdgeAlignedRight,BottomEdgeAlignedLeft,BottomEdgeAlignedRight,LeftEdgeAlignedTop,LeftEdgeAlignedBottom,RightEdgeAlignedTop,RightEdgeAlignedBottom" default="Bottom" />
  655. <attribute name="show-mode" type="enum" values="Standard,Transient,TransientWithDismissOnPointerMoveAway" default="Standard" />
  656. </attributes>
  657. <behavior>
  658. <event name="opened" />
  659. <event name="closed" />
  660. </behavior>
  661. </control>
  662. <control name="Window" type="container" category="avalonia-window">
  663. <constraints>
  664. <allowed-parents>none</allowed-parents>
  665. <allowed-children>single-child</allowed-children>
  666. <container>true</container>
  667. <max-children>1</max-children>
  668. </constraints>
  669. <attributes>
  670. <attribute name="title" type="string" default="" />
  671. <attribute name="width" type="double" default="800" min="200" max="4000" />
  672. <attribute name="height" type="double" default="600" min="150" max="3000" />
  673. <attribute name="min-width" type="double" default="0" min="0" />
  674. <attribute name="min-height" type="double" default="0" min="0" />
  675. <attribute name="max-width" type="double" default="Infinity" />
  676. <attribute name="max-height" type="double" default="Infinity" />
  677. <attribute name="can-resize" type="bool" default="true" />
  678. <attribute name="show-in-taskbar" type="bool" default="true" />
  679. <attribute name="topmost" type="bool" default="false" />
  680. <attribute name="window-state" type="enum" values="Normal,Minimized,Maximized,FullScreen" default="Normal" />
  681. <attribute name="window-startup-location" type="enum" values="Manual,CenterScreen,CenterOwner" default="Manual" />
  682. <attribute name="system-decorations" type="enum" values="Full,BorderOnly,None" default="Full" />
  683. <attribute name="extend-client-area-to-decorations-hint" type="bool" default="false" />
  684. <attribute name="extend-client-area-chrome-hints" type="enum" values="Default,PreferSystemChrome,PreferClientChrome,NoChrome" default="Default" />
  685. <attribute name="extend-client-area-title-bar-height-hint" type="double" default="-1" />
  686. </attributes>
  687. <behavior>
  688. <event name="activated" />
  689. <event name="deactivated" />
  690. <event name="closing" />
  691. <event name="closed" />
  692. <event name="opened" />
  693. <event name="position-changed" />
  694. <event name="resize-started" />
  695. <event name="resize-ended" />
  696. <event name="window-state-changed" />
  697. </behavior>
  698. </control>
  699. <control name="UserControl" type="container" category="avalonia-container">
  700. <constraints>
  701. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,Border,ScrollViewer</allowed-parents>
  702. <allowed-children>single-child</allowed-children>
  703. <container>true</container>
  704. <max-children>1</max-children>
  705. </constraints>
  706. <attributes>
  707. <attribute name="content" type="object" default="null" />
  708. </attributes>
  709. </control>
  710. <!-- Media Controls -->
  711. <control name="MediaElement" type="media" category="avalonia-media">
  712. <constraints>
  713. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  714. <allowed-children>none</allowed-children>
  715. <container>false</container>
  716. </constraints>
  717. <attributes>
  718. <attribute name="source" type="string" default="" />
  719. <attribute name="volume" type="double" default="0.5" min="0" max="1" />
  720. <attribute name="is-muted" type="bool" default="false" />
  721. <attribute name="auto-play" type="bool" default="false" />
  722. <attribute name="stretch" type="enum" values="None,Fill,Uniform,UniformToFill" default="Uniform" />
  723. <attribute name="position" type="timespan" default="00:00:00" />
  724. </attributes>
  725. <behavior>
  726. <event name="media-opened" />
  727. <event name="media-ended" />
  728. <event name="media-failed" />
  729. <event name="position-changed" />
  730. <event name="buffering-started" />
  731. <event name="buffering-ended" />
  732. </behavior>
  733. </control>
  734. <!-- Advanced Input Controls -->
  735. <control name="MaskedTextBox" type="input" category="avalonia-input">
  736. <constraints>
  737. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  738. <allowed-children>none</allowed-children>
  739. <container>false</container>
  740. </constraints>
  741. <attributes>
  742. <attribute name="mask" type="string" default="" />
  743. <attribute name="prompt-char" type="char" default="_" />
  744. <attribute name="culture" type="string" default="en-US" />
  745. <attribute name="ascii-only" type="bool" default="false" />
  746. <attribute name="reset-on-prompt" type="bool" default="true" />
  747. <attribute name="reset-on-space" type="bool" default="true" />
  748. <attribute name="skip-literals" type="bool" default="true" />
  749. </attributes>
  750. <behavior>
  751. <event name="mask-input-rejected" />
  752. <event name="text-mask-format-changed" />
  753. </behavior>
  754. </control>
  755. <control name="ColorPicker" type="input" category="avalonia-input">
  756. <constraints>
  757. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  758. <allowed-children>none</allowed-children>
  759. <container>false</container>
  760. </constraints>
  761. <attributes>
  762. <attribute name="color" type="color" default="#FFFFFF" />
  763. <attribute name="is-alpha-enabled" type="bool" default="true" />
  764. <attribute name="is-color-slider-visible" type="bool" default="true" />
  765. <attribute name="is-color-palette-visible" type="bool" default="true" />
  766. <attribute name="is-hex-input-visible" type="bool" default="true" />
  767. <attribute name="palette-column-count" type="int" default="10" min="1" max="20" />
  768. </attributes>
  769. <behavior>
  770. <event name="color-changed" />
  771. </behavior>
  772. </control>
  773. <!-- Drawing and Canvas Controls -->
  774. <control name="PathIcon" type="display" category="avalonia-graphics">
  775. <constraints>
  776. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas,Button</allowed-parents>
  777. <allowed-children>none</allowed-children>
  778. <container>false</container>
  779. </constraints>
  780. <attributes>
  781. <attribute name="data" type="geometry" default="" />
  782. <attribute name="foreground" type="brush" default="Black" />
  783. </attributes>
  784. </control>
  785. <control name="Viewbox" type="container" category="avalonia-layout">
  786. <constraints>
  787. <allowed-parents>Panel,StackPanel,Grid,DockPanel,Canvas</allowed-parents>
  788. <allowed-children>single-child</allowed-children>
  789. <container>true</container>
  790. <max-children>1</max-children>
  791. </constraints>
  792. <attributes>
  793. <attribute name="stretch" type="enum" values="None,Fill,Uniform,UniformToFill" default="Uniform" />
  794. <attribute name="stretch-direction" type="enum" values="UpOnly,DownOnly,Both" default="Both" />
  795. </attributes>
  796. </control>
  797. <!-- Notification Controls -->
  798. <control name="NotificationCard" type="display" category="avalonia-notification">
  799. <constraints>
  800. <allowed-parents>Panel,StackPanel,Grid</allowed-parents>
  801. <allowed-children>any-content</allowed-children>
  802. <container>true</container>
  803. </constraints>
  804. <attributes>
  805. <attribute name="notification-type" type="enum" values="Information,Success,Warning,Error" default="Information" />
  806. <attribute name="is-closable" type="bool" default="true" />
  807. <attribute name="close-on-click" type="bool" default="false" />
  808. </attributes>
  809. <behavior>
  810. <event name="closed" />
  811. <event name="closing" />
  812. </behavior>
  813. </control>
  814. <!-- Custom Structures and Patterns -->
  815. <structure name="AvaloniaFormField" type="pattern" category="avalonia-composite" inherits="FormField">
  816. <constraints>
  817. <allowed-parents>StackPanel,Grid,UniformGrid</allowed-parents>
  818. <allowed-children>Label,AvaloniaTextBox,AvaloniaComboBox,CheckBox,NumericUpDown</allowed-children>
  819. <container>true</container>
  820. <required-slots>input</required-slots>
  821. </constraints>
  822. <attributes>
  823. <attribute name="label-text" type="string" required="true" />
  824. <attribute name="required" type="bool" default="false" />
  825. <attribute name="validation-message" type="string" default="" />
  826. <attribute name="help-text" type="string" default="" />
  827. <attribute name="label-width" type="double" default="120" min="50" max="300" />
  828. </attributes>
  829. <template>
  830. <Grid name="fieldContainer">
  831. <grid-definitions>
  832. <column-definitions>
  833. <column-definition width="{label-width}" />
  834. <column-definition width="*" />
  835. </column-definitions>
  836. <row-definitions>
  837. <row-definition height="Auto" />
  838. <row-definition height="Auto" />
  839. </row-definitions>
  840. </grid-definitions>
  841. <AvaloniaLabel name="fieldLabel" text="{label-text}" grid-column="0" grid-row="0" />
  842. <slot name="input" allowed-controls="AvaloniaTextBox,AvaloniaComboBox,CheckBox,NumericUpDown" required="true" grid-column="1" grid-row="0" />
  843. <TextBlock name="helpText" text="{help-text}" grid-column="1" grid-row="1"
  844. font-size="11" foreground="Gray" visible="{help-text != ''}" />
  845. <TextBlock name="validationLabel" text="{validation-message}" grid-column="1" grid-row="1"
  846. visible="false" foreground="Red" font-size="11" />
  847. </Grid>
  848. </template>
  849. </structure>
  850. <structure name="AvaloniaButtonBar" type="pattern" category="avalonia-composite">
  851. <constraints>
  852. <allowed-parents>Panel,StackPanel,Grid,DockPanel</allowed-parents>
  853. <allowed-children>AvaloniaButton</allowed-children>
  854. <container>true</container>
  855. <max-children>10</max-children>
  856. </constraints>
  857. <attributes>
  858. <attribute name="alignment" type="enum" values="Left,Center,Right,Stretch" default="Right" />
  859. <attribute name="spacing" type="double" default="5" min="0" max="20" />
  860. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Horizontal" />
  861. </attributes>
  862. <template>
  863. <StackPanel name="buttonContainer" orientation="{orientation}" spacing="{spacing}">
  864. <slot name="buttons" allowed-controls="AvaloniaButton" />
  865. </StackPanel>
  866. </template>
  867. </structure>
  868. <structure name="AvaloniaToolbar" type="pattern" category="avalonia-composite">
  869. <constraints>
  870. <allowed-parents>DockPanel,Grid,StackPanel</allowed-parents>
  871. <allowed-children>AvaloniaButton,Separator</allowed-children>
  872. <container>true</container>
  873. </constraints>
  874. <attributes>
  875. <attribute name="orientation" type="enum" values="Horizontal,Vertical" default="Horizontal" />
  876. <attribute name="band" type="int" default="0" min="0" max="10" />
  877. <attribute name="band-index" type="int" default="0" min="0" max="100" />
  878. </attributes>
  879. <template>
  880. <Border name="toolbarBorder" background="LightGray" border-thickness="0,0,0,1" border-brush="Gray">
  881. <StackPanel name="toolbarPanel" orientation="{orientation}" margin="2">
  882. <slot name="toolbar-items" allowed-controls="AvaloniaButton,Separator" />
  883. </StackPanel>
  884. </Border>
  885. </template>
  886. </structure>
  887. <structure name="AvaloniaStatusBar" type="pattern" category="avalonia-composite">
  888. <constraints>
  889. <allowed-parents>DockPanel,Grid</allowed-parents>
  890. <allowed-children>TextBlock,ProgressBar,Separator</allowed-children>
  891. <container>true</container>
  892. </constraints>
  893. <attributes>
  894. <attribute name="height" type="double" default="23" min="20" max="50" />
  895. </attributes>
  896. <template>
  897. <Border name="statusBorder" background="LightGray" border-thickness="0,1,0,0" border-brush="Gray" height="{height}">
  898. <DockPanel name="statusPanel" last-child-fill="true">
  899. <slot name="status-items" allowed-controls="TextBlock,ProgressBar,Separator" />
  900. </DockPanel>
  901. </Border>
  902. </template>
  903. </structure>
  904. <wireframe name="AvaloniaMainWindow" type="base-layout">
  905. <description>Standard Avalonia application window with menu, toolbar, status bar, and content area</description>
  906. <template>
  907. <DockPanel name="mainContainer">
  908. <slot name="menu-bar" dock="Top" default="true">
  909. <MenuBar name="mainMenu">
  910. <slot name="menu-items" />
  911. </MenuBar>
  912. </slot>
  913. <slot name="toolbar" dock="Top" default="true">
  914. <AvaloniaToolbar name="mainToolbar">
  915. <slot name="toolbar-items" />
  916. </AvaloniaToolbar>
  917. </slot>
  918. <slot name="status-bar" dock="Bottom" default="true">
  919. <AvaloniaStatusBar name="mainStatusBar">
  920. <slot name="status-items" />
  921. </AvaloniaStatusBar>
  922. </slot>
  923. <slot name="main-content" required="true" />
  924. </DockPanel>
  925. </template>
  926. </wireframe>
  927. <wireframe name="AvaloniaDialog" type="base-layout">
  928. <description>Standard Avalonia dialog layout with content and button areas</description>
  929. <template>
  930. <Border name="dialogBorder" background="White" border-brush="Gray" border-thickness="1" corner-radius="4">
  931. <DockPanel name="dialogContainer" margin="10">
  932. <slot name="dialog-buttons" dock="Bottom" default="true">
  933. <AvaloniaButtonBar name="dialogButtons" alignment="Right" margin="0,10,0,0">
  934. <AvaloniaButton name="okButton" text="OK" is-default="true" />
  935. <AvaloniaButton name="cancelButton" text="Cancel" is-cancel="true" />
  936. </AvaloniaButtonBar>
  937. </slot>
  938. <slot name="dialog-content" required="true" />
  939. </DockPanel>
  940. </Border>
  941. </template>
  942. </wireframe>
  943. </patterns>