--- /dev/null
+<?xml version="1.0"?>
+<TreeView IsRoot="true" Name="treeView" Data="{./CurrentDirectory}"
+ SelectedItemChanged="./onSelectedItemChanged">
+ <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 Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+ <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+ 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}" Width="{./WidthPolicy}"/>
+ </HorizontalStack>
+ <Container Name="Content" Visible="false"
+ Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+ </VerticalStack>
+ </Template>
+ <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+ <GraphicObject Width="12" Height="10"/>
+ <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}"
+ Template="#Tests.Interfaces.treeList.crow" />
+ </HorizontalStack>
+ </Expandable>
+ </ItemTemplate>
+</TreeView>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<Window Height="80%" Width="80%">
+ <HorizontalStack>
+ <DirectoryView Name="dv" Root="./" SelectedItemChanged="Tv_SelectedItemChanged"
+ Width="20%" Height="100%" Margin="10"/>
+ <Splitter/>
+ <VerticalStack Width="80%" Height="100%">
+ <Container Height="50%" Margin="10" MinimumSize="10,1"
+ Name="crowContainer"/>
+ <Splitter/>
+ <HorizontalStack Height="50%" Margin="10" MinimumSize="10,1">
+ <Scroller Name="scroller1" Background="White"
+ Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
+ ValueChanged="./_scroller_ValueChanged">
+ <TextBox Background="White" Height="Fit"
+ VerticalAlignment="Top"
+ TextAlignment="TopLeft" Font="mono, 10"
+ Text="{CurSources}" Multiline="true"/>
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
+ Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Width="14" />
+ </HorizontalStack>
+ </VerticalStack>
+ </HorizontalStack>
+</Window>
--- /dev/null
+<?xml version="1.0"?>
+<HorizontalStack>
+ <Window Resizable="false" Focusable="true" Title="Open File..." Width="20%" Height="100%"
+ MinimumSize="10,1">
+ <DirectoryView Name="dv" Margin="10" Root="./" SelectedItemChanged="Tv_SelectedItemChanged"/>
+ </Window>
+ <Splitter/>
+ <VerticalStack Width="80%" Height="100%">
+ <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
+ Height="50%" Width="Stretched"
+ MinimumSize="10,1">
+ <Container Margin="10" Name="crowContainer"/>
+ </Window>
+ <Splitter/>
+ <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
+ Height="50%" Width="Stretched"
+ MinimumSize="10,1">
+ <TextBox Multiline="true" Margin="10" Height="Stretched"
+ Text="{CurSources}"/>
+ </Window>
+ </VerticalStack>
+</HorizontalStack>
--- /dev/null
+<?xml version="1.0"?>
+<Label Margin="50" MinimumSize="10,10" Background="Onyx" Text="{PropertyLessBinding}"/>
\ No newline at end of file
--- /dev/null
+//
+// DirectoryView.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using System.IO;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.DirectoryView.crow")]
+ public class DirectoryView : TemplatedControl
+ {
+ #region CTOR
+ public DirectoryView ()
+ : base()
+ {}
+ #endregion
+
+ #region events
+ public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged;
+ #endregion
+
+ string _root = "/";
+ bool _showFiles;
+
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool ShowFiles {
+ get { return _showFiles; }
+ set {
+ if (_showFiles == value)
+ return;
+ _showFiles = value;
+ NotifyValueChanged ("ShowFiles", _showFiles);
+ }
+ }
+ [XmlAttributeAttribute][DefaultValue("/")]
+ public virtual string Root {
+ get { return _root; }
+ set {
+ if (_root == value)
+ return;
+ _root = value;
+ NotifyValueChanged ("Root", _root);
+ NotifyValueChanged ("CurrentDirectory", CurrentDirectory);
+ }
+ }
+ [XmlIgnore]public FileSystemInfo[] CurrentDirectory {
+ get { return new DirectoryInfo (Root).GetFileSystemInfos (); }
+ }
+ public void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){
+ SelectedItemChanged.Raise (this, e);
+ }
+ }
+}
+