Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            _collectionItems        = new List <CollectionItem>();
            _viewCollection         = new CollectionViewSource();
            _viewCollection.Filter += ViewCollectionFilter;

            if (File.Exists(CollectionFileName))
            {
                _projectCollection    = ProjectCollection.LoadFromFile(CollectionFileName);
                TbRootProjectDir.Text = _projectCollection.RootDir;
                ShowCollection();
                ShowTags();
            }
            else
            {
                TbRootProjectDir.Text = Properties.Settings.Default.RootPath;
                _projectCollection    = new ProjectCollection();
            }
            _viewCollection.Source = _collectionItems;
            //_viewCollection.SortDescriptions.Add(new SortDescription("FullPath", ListSortDirection.Ascending));
            LvProjects.ItemsSource = _viewCollection.View;
            _folders     = CreateTree();
            _viewFolders = new CollectionViewSource {
                Source = _folders
            };
            TvFolders.ItemsSource = _viewFolders.View;
        }