コード例 #1
0
        public FileExplorerTree()
        {
            InitializeComponent();

            folderIconStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VenoMpie.Common.WPF.Controls.FileExplorer.Icons.folder.png");
            driveIconStream  = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VenoMpie.Common.WPF.Controls.FileExplorer.Icons.drive.png");
            folderIcon       = BitmapHelpers.ConvertStreamToBitmapImage(folderIconStream);
            driveIcon        = BitmapHelpers.ConvertStreamToBitmapImage(driveIconStream);

            DriveInfo[] drives = DriveInfo.GetDrives();
            foreach (DriveInfo driveInfo in drives)
            {
                FileExplorerTreeItem fe = new FileExplorerTreeItem(driveInfo, driveIcon);
                fe.Items.Add(new FileExplorerTreeItem());
                myList.Add(fe);
            }

            tvwExplorer.ItemsSource = myList;
        }