Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important improvements and new components to the codebase, focusing on better separation of concerns, enhanced MVVM (Model-View-ViewModel) practices, and improved UI binding and effects. The most significant changes include the introduction of reusable services and converters, refactoring of command handling to the ViewModel, and new infrastructure for edge light geometry and interaction.
MVVM and Command Refactoring:
ControlWindow.xaml.csto delegate all UI actions (such as brightness, color, toggle, monitor switching, and exit) to correspondingICommandproperties in theMainViewModel, instead of directly calling methods onMainWindow. This enables better testability and separation of concerns. [1] [2]RelayCommandclass for implementingICommandlogic in the ViewModel, supporting both execution and can-execute logic.UI Binding and Converters:
BooleanToVisibilityConverterand registered it as a resource inMainWindow.xaml, enabling clean binding of boolean ViewModel properties (likeIsLightVisible) to UI element visibility. [1] [2] [3]MainWindow.xamlto bind itsOpacity,Visibility, and gradient stops to ViewModel properties, improving responsiveness to state changes.Edge Light Geometry and Effects:
MonitorWindowContext, a model encapsulating all properties needed for rendering the edge light effect per monitor, supporting multi-monitor setups and DPI scaling.FrameGeometryManager, a service responsible for creating the edge light frame geometry, handling mouse tracking, and applying the "hole punch" effect when the cursor is near the frame. This includes global mouse hook installation and advanced geometry calculations.GeometryService, a reusable service for frame geometry calculations, including methods for generating the frame's geometry and rectangles used for hover detection.Hotkey Management:
HotkeyService, a service for registering and unregistering global hotkeys using Windows API, abstracted behind an interface for testability and reuse.