I have a problem here ;
I've create a treeview in c# like this code ,but
How can I do this in wpf (xaml); ?
public void PopulateTreeView( string dirValue, TreeNode parentNode )
{
string[] directoryArray = Directory.GetDirectories( dirValue);
try
{
if ( directoryArray.Length != 0 )
{
foreach ( string directory in directoryArray )
{
substringDirectory = Path.GetFileNameWithoutExtension(directory );
TreeNode myNode = new TreeNode( substringDirectory );
parentNode.Nodes.Add( myNode );
PopulateTreeView( directory, myNode );
}
}
}
catch ( UnauthorizedAccessException )
{
parentNode.Nodes.Add( "Access denied !" );
}
}
please explain clearly or post a snippet code (cause I'm new in xaml). Tanx
I've posted this question here but it doesn't help me.