aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests/Interfaces/TemplatedContainer/testTreeView.crow
blob: fb4cbe873a0c985c6760cc24e8e2030139b20fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0"?>
<TreeView IsRoot="true" Name="treeView" Data="{CurDirectory}" Background="DimGray">
	<ItemTemplate DataType="System.IO.FileInfo">
		<HorizontalStack Focusable="true"  Height="Fit" Width="Stretched" Background="{../Background}" >
			<Image Margin="2" Width="14" Height="14"
				Path="#Crow.Images.Icons.file.svg"/>
			<Label Text="{Name}" Width="Stretched"
				MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
				MouseLeave="{Background=Transparent}"/>
		</HorizontalStack>
	</ItemTemplate>
	<ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
		<Expandable Caption="{Name}" >
			<Template>
				<VerticalStack>
					<HorizontalStack Spacing="1" Height="Fit"
							MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
							MouseLeave="{Background=Transparent}">
						<Image Margin="2" Width="12" Height="12"
							Visible="{./HasContent}"
							Path="{./Image}"
							SvgSub="{./IsExpanded}"/>
						<Image Margin="2" Width="14" Height="14"
							Path="#Crow.Images.Icons.folder.svg"/>
						<Label Text="{./Caption}"/>
					</HorizontalStack>
					<Container Name="Content" Visible="false"/>
				</VerticalStack>
			</Template>
			<HorizontalStack Height="Fit">
				<GraphicObject Width="12" Height="10"/>
				<TreeView Name="List" Height="Fit">
					<Template>
						<VerticalStack Height="Fit" Name="ItemsContainer"/>
					</Template>
				</TreeView>
			</HorizontalStack>
		</Expandable>
	</ItemTemplate>
</TreeView>