Skip to content

Conversation

@vb2ae
Copy link
Member

@vb2ae vb2ae commented Oct 20, 2025

Refactor visual parent retrieval logic for PopupRoot handling.

vb2ae added 6 commits October 20, 2025 08:49
Refactor visual parent retrieval logic for PopupRoot handling.
Introduce `popupUI` alias for `Primitives` namespace to streamline `Popup` control references across Windows.UI.Xaml, Avalonia, Microsoft.UI.Xaml, and System.Windows. Fix a bug in `PopupRoot` handling by correcting a variable name and updating logic for setting `pElement`. Remove unused code for cleaner implementation. Ensure consistency and adaptability with conditional compilation.
Refactor visual parent retrieval logic for PopupRoot handling.
Introduce `popupUI` alias for `Primitives` namespace to streamline `Popup` control references across Windows.UI.Xaml, Avalonia, Microsoft.UI.Xaml, and System.Windows. Fix a bug in `PopupRoot` handling by correcting a variable name and updating logic for setting `pElement`. Remove unused code for cleaner implementation. Ensure consistency and adaptability with conditional compilation.
Copy link
Contributor

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.

Pull Request Overview

This PR refactors the visual parent retrieval logic in ActionMessage to properly handle PopupRoot elements across different UI platforms (WinUI, UWP, Avalonia, WPF). The change adds platform-specific namespace aliases and implements conditional logic to navigate up the visual tree through popup hierarchies.

Key changes:

  • Added popupUI namespace aliases for all platform-specific conditionals to access Popup primitives
  • Implemented special handling for PopupRoot elements to correctly traverse the visual tree hierarchy

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

vb2ae added 4 commits October 22, 2025 18:42
Simplified the condition checking for `currentElement` by directly verifying if it is a `popupUI.Popup` and its parent is also a `popupUI.Popup`. This refactoring removes unnecessary nesting and streamlines the logic. Adjusted conditional compilation directives to integrate assignments within the main condition block, enhancing code readability and maintainability.
Updated `Caliburn.Micro.Avalonia.csproj` and `Caliburn.Micro.Maui.csproj` to improve package management and documentation generation:
- Added targets for managing project references and reference assemblies.
- Prevented building project references when `NoBuild` is true.
- Excluded `.xml` files from allowed output extensions.
- Enabled XML documentation generation and disabled symbol package generation.

Enhanced `ActionMessage.cs` to handle `PopupRoot` elements:
- Added logic to determine the parent or placement target of popups.
- Used conditional compilation for platform-specific behavior.
Removed logic for handling PopupRoot elements and setting
pElement based on WINDOWS_UWP directive. This code was
responsible for navigating the visual tree to find the
appropriate parent or target for a popup element.

Added a logging statement under the AVALONIA directive to
log "SetMethodBinding avalonia," indicating a shift in focus
towards Avalonia-specific functionality and possibly a change
in how popups are managed in the application.
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