C# and WPF tutorial files

This commit is contained in:
Unknown
2017-05-29 21:01:07 +01:00
parent dfdd754362
commit 1cb838df3a
107 changed files with 5760 additions and 0 deletions

View File

@ -0,0 +1,37 @@
using System.Collections.ObjectModel;
using System.Linq;
namespace WpfTreeView
{
/// <summary>
/// The view model for the applications main Directory view
/// </summary>
public class DirectoryStructureViewModel : BaseViewModel
{
#region Public Properties
/// <summary>
/// A list of all directories on the machine
/// </summary>
public ObservableCollection<DirectoryItemViewModel> Items { get; set; }
#endregion
#region Constructor
/// <summary>
/// Default constructor
/// </summary>
public DirectoryStructureViewModel()
{
// Get the logical drives
var children = DirectoryStructure.GetLogicalDrives();
// Create the view models from the data
this.Items = new ObservableCollection<DirectoryItemViewModel>(
children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive)));
}
#endregion
}
}