Skip to content

Conversation

@phenixita
Copy link
Contributor

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:

  • Refactored ControlWindow.xaml.cs to delegate all UI actions (such as brightness, color, toggle, monitor switching, and exit) to corresponding ICommand properties in the MainViewModel, instead of directly calling methods on MainWindow. This enables better testability and separation of concerns. [1] [2]
  • Added a reusable RelayCommand class for implementing ICommand logic in the ViewModel, supporting both execution and can-execute logic.

UI Binding and Converters:

  • Introduced a BooleanToVisibilityConverter and registered it as a resource in MainWindow.xaml, enabling clean binding of boolean ViewModel properties (like IsLightVisible) to UI element visibility. [1] [2] [3]
  • Updated the edge light border in MainWindow.xaml to bind its Opacity, Visibility, and gradient stops to ViewModel properties, improving responsiveness to state changes.

Edge Light Geometry and Effects:

  • Added MonitorWindowContext, a model encapsulating all properties needed for rendering the edge light effect per monitor, supporting multi-monitor setups and DPI scaling.
  • Introduced 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.
  • Added GeometryService, a reusable service for frame geometry calculations, including methods for generating the frame's geometry and rectangles used for hover detection.

Hotkey Management:

  • Added HotkeyService, a service for registering and unregistering global hotkeys using Windows API, abstracted behind an interface for testability and reuse.

Copilot AI review requested due to automatic review settings December 15, 2025 17:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

1 participant