Skip to content

Conversation

@tajbender
Copy link
Member

No description provided.

tajbender added 30 commits March 2, 2025 19:31
Cleanup for new `Reconfigure` Branch
Cleanup for new `Reconfigure` Branch
- Added .editorconfig and .vsconfig for coding standards.
- Updated project files to target .NET 7.0 and include necessary packages.
- Created IFileService interface and implemented FileService for file handling.
- Enhanced README.md with setup, testing, and CI information.
- Introduced navigation and theme management services.
- Implemented view models and pages for application UI.
- Added support for app notifications and local settings management.
- Created resource files for UI styling and localization.
- Updated app manifest and main window setup for improved user experience.
- Added various assets and configuration files for project metadata.
Removed outdated packages and updated to newer versions for
`coverlet.collector`, `Microsoft.NET.Test.Sdk`, `MSTest.TestAdapter`,
and `MSTest.TestFramework`. Added asset management properties for
`coverlet.collector` and included a new reference for
`System.Text.Json`.
This commit removes the `BlankViewModel` and `BlankPage` classes, along with their registrations in the dependency injection container. In their place, a new `FileManagementViewModel` and `FileManagementPage` have been introduced and registered in `App.xaml.cs`. The `PageService` class has been updated to configure the new view model and page. Additionally, the `BlankViewModel.cs` and `BlankPage.xaml.cs` files have been deleted. The solution file has also been updated to remove references to the `electrifier.Tests.MSTest` project.
- Changed `ViewModel` in `FileManagementPage.xaml.cs` to use a private readonly field for better encapsulation and performance.
- Updated `ShellPage.xaml` to navigate to `FileManagementViewModel` instead of `BlankViewModel`, aligning navigation with file management functionality.
Significantly updated the `PRIVACY.md` file to include a comprehensive Privacy Policy, covering the collection, use, and disclosure of personal information, along with user rights and company obligations.

Made structural changes to the `Resources.resw` file, including adding comments for clarity, modifying the `AppDescription`, removing `Shell_Blank.Content`, and adding `Shell_FileManagement.Content`. Updated `Settings_AboutDescription.Text` for specificity and ensured proper XML formatting.
- Removed unused using directives in PageService.cs.
- Updated application name and descriptions in Resources.resw for clarity.
- Added viewmodels namespace in MainPage.xaml and removed ContentArea grid.
- Enhanced NavigationView properties in ShellPage.xaml for improved navigation functionality.
This commit introduces an `AutoSuggestBox` to the `NavigationView` for improved search functionality. The previous `HeaderTemplate` and redundant `AutoSuggestBox` have been removed, streamlining the navigation interface.
Updated `NavigationService.cs` to include a TODO for a "Swoosh" sound effect on successful navigation and adjusted the return statement for navigation results.

In `ShellPage.xaml`, added a `NavigationViewItemSeparator` to enhance the layout and organization of the navigation menu.
This update introduces a `CommandBar` to the `FileManagementPage.xaml`, featuring `AppBarButton` elements for actions like "New", "Cut", "Copy", "Paste", "Rename", "Share", and "Delete". It also includes `SplitButton` elements for sorting, viewing, filtering, and tagging options. Additionally, secondary commands such as "Undo", "Pin to Quick access", and "Select all" are added, improving the overall user interface and functionality for file management tasks.
Changed HeaderMode to "Never" and added grid rows.
Introduced ContentStackPanel for file management content and
added StatusCommandBar with disabled buttons for items,
folders, files, size, and hidden status.
Updated FileManagementPage.xaml to replace the previous StackPanel with a new ExplorerBrowser control, enhancing the file management interface. Modified electrifier.csproj to include ExplorerBrowser.xaml as a Page for proper compilation. Created ExplorerBrowser.xaml and ExplorerBrowser.xaml.cs to define the control's layout and functionality.
Replaced single TextBlock with a grid layout containing three column definitions. The new layout includes a TextBlock that spans all columns, maintaining the placeholder text. Commented-out code for potential future implementation of ShellNamespaceTreeControl and ShellListView has been added.
This commit introduces two new user controls, `ShellListView` and `ShellNamespaceTreeControl`, to the project. The `ExplorerBrowser.xaml` has been updated to incorporate these controls, replacing a placeholder text block. The project file (`electrifier.csproj`) has been modified to remove references to the old `ExplorerBrowser.xaml` and to include the new controls for proper compilation. Both new controls have their respective XAML and code-behind files created, each containing a placeholder message for future content.
Introduced `BrowserItemFactory`, `AbstractBrowserItem<T>`, and `BrowserItem` classes for managing shell items. Updated `ShellNamespaceTreeControl.xaml` to include a `TreeView` with a custom `DataTemplate` for displaying browser items. Updated `electrifier.csproj` to enable C# 12.0 and added references for `Vanara.Windows.Shell` packages. These changes enhance the application's functionality for representing and interacting with shell items.
Updated `ExplorerBrowser.xaml` to enhance grid layout by renaming and repositioning controls. Introduced `PrimaryShellTreeView`, `PrimaryShellListView`, `SecondaryShellTreeView`, and `SecondaryShellListView`.

Modified `MainPage.xaml` to add `controls` namespace, change grid name to `MainPageContent`, and include a new `ExplorerBrowser` control in the layout.
This commit introduces an `ItemsView` element within a `ScrollView`, binding its `ItemsSource` to the `Items` property and utilizing the `ItemsViewBrowserItemTemplate` for item presentation. This enhancement allows for a more effective and scrollable display of a collection of items in the UI.
Updated ShellListView.xaml to clarify ScrollView usage and added a comment for future DataTable integration.
In ShellNamespaceTreeControl.xaml.cs, added a using directive, simplified the constructor, and improved the SelectionChanged property to handle item selection events correctly.
Introduce a `TreeView` bound to an `ObservableCollection<BrowserItem>` in the XAML. Update the code-behind to include necessary using directives, expose the `TreeView` through a new property, and initialize the `DataContext` and `Items` collection. Implement a `Loading` event handler to populate the `Items` with a root item for the desktop folder, with plans for additional items from known folders in the future.
Updated ExplorerBrowser to initialize both tree views with items and improved selection handling in NativeTreeView_SelectionChanged. Added debug logging for selected items. In ShellNamespaceTreeControl, set TreeViewItemIsSelected for the root item and preserved commented-out code for known folders.
Restructured the BrowserItemFactory with an abstract base class `AbstractBrowserItem<T>` that includes properties for child items and folder status. Updated the `BrowserItem` class to add `DisplayName` and `TreeViewItemIsSelected` properties, along with improved XML documentation for `HasUnrealizedChildren`.

Changed the access modifier of `NativeItemsView` in `ShellListView.xaml.cs` from public to internal and initialized the `Items` collection. Simplified selection change handling in `ShellNamespaceTreeControl.xaml.cs` using pattern matching for better readability.
Commented out the `SelectionChanged` event handlers in
`ExplorerBrowser.xaml.cs` and `ShellNamespaceTreeControl.xaml.cs`
to temporarily disable selection change functionality. Also,
removed the addition of a new `BrowserItem` in
`ShellListView.xaml.cs` constructor.
- Added `ExplorerBrowser_Loading` event handler for loading.
- Removed direct item additions to `PrimaryShellTreeView` and `SecondaryShellTreeView`.
- Updated `NativeTreeView_SelectionChanged` method for clarity.
- Enhanced `Navigate` method with null assertion for `shTargetItem`.
- Retained item addition to `PrimaryShellListView`, removed old comments.
Changed DefaultLabelPosition to "Collapsed" for the CommandBar. Added AppBarButtons for "Back", "Forward", and "Parent Folder", along with an AppBarSeparator. Modified the "New" button to include a Flyout with a StackPanel for additional options.
This change ensures that the Navigated event is only invoked if the shFolder object is not null. This enhancement improves the robustness of the code by preventing potential null reference exceptions.
- Cleaned up the constructor of `ExplorerBrowser` by removing commented-out code and unnecessary event subscriptions. Added error handling for navigation logic.
- Updated `BrowserItemFactory.cs` to include a new `using` directive and removed an obsolete one, reflecting namespace restructuring.
- Enhanced `ShellBrowserItem` with an `IsSelected` property and asynchronous initialization for `SoftwareBitmap`. Introduced `InitializeSoftwareBitmapAsync` for better icon retrieval.
- Overall improvements in code clarity, maintainability, and UI responsiveness.
Updated the `Navigated` event to use `Vanara.Windows.Shell.NavigatedEventArgs` and added a new `NavigationFailed` event with `Vanara.Windows.Shell.NavigationFailedEventArgs`. Removed the `Navigate` method, which handled navigation and item population in the shell list view, along with its associated error handling logic.
- Updated `ShellBrowserItem` to include `nameof(SoftwareBitmap` in `SetField` and return `softwareBitmapSource`.
- Changed `Image` binding in `ShellListView.xaml` to `Mode=OneWay` for better data flow control.
- Reformatted `ShellNamespaceTreeControl.xaml` for improved readability and adjusted layout properties for `Image` and `TextBlock`.
- Removed `IsRootItem` property and `isFolder` parameter from `AbstractBrowserItem`, now only accepts child items.
- Updated `ExplorerBrowser` to create a `rootItem` for better child item enumeration and error handling.
- Modified `BrowserItemFactory` and `ShellBrowserItem` constructors to eliminate the `isFolder` parameter.
- Enhanced `ShellListView` with a new `AddItems` method for batch item addition.
- Adjusted `Shel32NamespaceService` and `ShellNamespaceTreeControl` to align with the new constructor signatures.
- Updated `ExplorerBrowser.xaml.cs` to include hidden items in the enumeration of child items by adding the `FolderItemFilter.IncludeHidden` flag.
- Renamed method in `BrowserItemFactory.cs` from `InitializeSoftwareBitmapAsync` to `GetStockIconBitmapAsync`, with improved comments for clarity on handling hidden and link items.
- Cleaned up formatting in `ShellListView.xaml` and added a transparent overlay for better visual feedback on hidden items.
- Added `OverlayBitmapSource` property to hold overlay bitmaps.
- Moved `IsLink` property for better accessibility.
- Refactored `GetStockIconBitmapAsync` to accept `Shell32.SHSTOCKICONID`.
- Updated logic for determining stock icon ID based on item type.
- Improved icon retrieval process for links and folders.

Enhance ShellBrowserItem with new properties and methods

- Added `OverlayBitmapSource` property to `ShellBrowserItem`.
- Moved `IsLink` property to improve class interface.
- Refactored `GetStockIconBitmapAsync` to accept a `Shell32.SHSTOCKICONID` parameter for better flexibility.
- Updated logic for determining stock icon ID based on item type.
- Removed the old implementation of `GetStockIconBitmapAsync` in favor of the new parameterized version.
Updated ShellBrowserItem to use properties for PIDL and OverlayBitmap.
Refactored logic for HasUnrealizedChildren and IsHidden to utilize
Attributes. Modified constructor and introduced async methods for
fetching stock icons.

In ShellListView.xaml, added OverlaySoftwareBitmap image,
replaced StackPanel with Grid layout, and corrected visibility
binding for HiddenItemOverlayBorder.
Updated `Vanara.Windows.Shell` and `Vanara.Windows.Shell.Common` from version `4.1.3` to `4.1.6`, removing the previous versions from the project file.
Updated `electrifier.csproj` to simplify `PackageReference` entries by removing specific version numbers and restructuring `PropertyGroup` elements. Removed unnecessary `ItemGroup` elements related to project capabilities and folders. Introduced `Directory.Packages.props` for centralized package version management, enhancing control over dependencies.
- Updated `AbstractBrowserItem` to use `IEnumerable` for `ChildItems` for better flexibility.
- Introduced `_isLoading` in `ExplorerBrowser` and replaced `PrimaryShellTreeView_Navigated` with an asynchronous `Navigate` method for improved navigation handling and error management.
- Modified `BrowserItemFactory` to change `FromPIDL` method to accept `ShellBrowserItem` instead of `AbstractBrowserItem<ShellItem>`.
- Adjusted `ShellBrowserItem` constructor to accept `ShellItem` directly and initialize `ChildItems` as an empty list if not provided.
- Enhanced UI representation by adding `ShellFolder.Desktop` as a `ShellBrowserItem` in `ShellNamespaceTreeControl`.

Refactor browser item classes for improved type safety

This commit refactors the `AbstractBrowserItem` and `ShellBrowserItem` classes to enhance type safety and functionality. The `ChildItems` property in `AbstractBrowserItem` is now an `IEnumerable`, and the constructor has been updated to remove the `childItems` parameter.

In the `ExplorerBrowser` class, a new `_isLoading` field has been added, and navigation logic has been refactored to use an asynchronous `Navigate` method for better control and error handling.

The `BrowserItemFactory` class has been updated to accept a `ShellItem` in the `ShellBrowserItem` constructor, improving code clarity. The `HomeShellFolder` method now creates a `ShellBrowserItem` directly from a `ShellItem`, ensuring consistency in object creation.

These changes collectively enhance the maintainability and readability of the codebase.
Remove link handling and overlay visuals in ShellBrowserItem

Commented out `IsHidden` and `IsLink` properties in the
`ShellBrowserItem` class, simplifying link item representation.
Removed logic for link icon overlays. In `ShellListView.xaml`,
the `ShellIconOverlay` image element has been commented out,
affecting the visual representation of hidden items.
The `AutoExpandAfterSelection` property was removed from the `ShellNamespaceTreeControl` class, eliminating the functionality for automatically expanding items after selection. Both the getter and setter for this property were deleted.
Updated `ExplorerBrowser.xaml.cs` to process child items on the UI thread using `DispatcherQueue.TryEnqueue`, improving thread safety and readability. Restructured the item addition logic for clarity.

Uncommented `IsHidden` and `IsLink` properties in `BrowserItemFactory.cs` to enhance the `ShellBrowserItem` class, allowing it to expose item attributes.
This commit introduces the `ExtractChildItems` method in the `BrowserItemFactory` class. This method uses the `ShellIconExtractor` to asynchronously extract icons for all child items in a specified folder. It includes parameters for the target folder and event handlers for icon extraction events. Additionally, a private method `IconExtOnComplete` is added to manage the completion of the extraction process. Comments and a reference to the source of the modifications are also included.
…with IconExtractor.

WARN: It's result PIDLs are relative!
Import referenced Event Classes into ExplorerBrowser
Still Issues with Transparency and absolute PIDLs.
Add History to `ExplorerBrowser`, minor changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants