Skip to content

Fix Avalonia UI feature conductor screen #991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

vb2ae
Copy link
Member

@vb2ae vb2ae commented Jul 20, 2025

  • Updated Bootstrapper.cs to call Initialize() after setting up the container and improved root view display with async handling.
  • Simplified ConductorView.axaml by changing x:Name to Name, removing nested elements, and introducing a new Panel for better data binding.
  • Added asynchronous activation methods in ConductorViewModel.cs for improved lifecycle management while retaining tab addition functionality.
  • Modified ShowFeature in MenuViewModel.cs for asynchronous navigation to feature view models.
  • Introduced ScreenExtenstionsTests.cs to validate activation and deactivation of screens and conductors.
  • Updated event handlers in NavigationFrame.cs to async methods for better responsiveness during navigation events.

Closing #968

- Updated `Bootstrapper.cs` to call `Initialize()` after setting up the container and improved root view display with async handling.
- Simplified `ConductorView.axaml` by changing `x:Name` to `Name`, removing nested elements, and introducing a new `Panel` for better data binding.
- Added asynchronous activation methods in `ConductorViewModel.cs` for improved lifecycle management while retaining tab addition functionality.
- Modified `ShowFeature` in `MenuViewModel.cs` for asynchronous navigation to feature view models.
- Introduced `ScreenExtenstionsTests.cs` to validate activation and deactivation of screens and conductors.
- Updated event handlers in `NavigationFrame.cs` to async methods for better responsiveness during navigation events.
@vb2ae vb2ae requested a review from Copilot July 20, 2025 11:51
Copilot

This comment was marked as outdated.

vb2ae and others added 4 commits July 21, 2025 20:50
- Updated `ListBox` in `ConductorView.axaml` to bind
  `SelectedItem` to `ActiveItem` for two-way data binding.
- Removed `OnActivateAsync` method in `ConductorViewModel.cs`
  to simplify the activation process.
- Adjusted `Loaded` event handling in `ActionMessage.cs`
  for improved clarity.
- Added convention in `ConventionManager.cs` to bind
  `ItemsSource` of `ListBox` to `DataContext`.
- Changed `Unloaded` event handler in `View.cs` to use
  `RoutedEventArgs` for proper cleanup in Avalon.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vb2ae vb2ae requested a review from Copilot July 22, 2025 17:08
Copy link
Contributor

@Copilot 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 fixes the Avalonia UI feature conductor screen by updating event handling, improving asynchronous lifecycle management, and enhancing UI data binding. The changes focus on replacing deprecated Avalonia events with current ones and implementing proper async patterns throughout the navigation system.

  • Updated Avalonia-specific event handling from DetachedFromLogicalTree to Unloaded events
  • Implemented asynchronous activation patterns in navigation and conductor components
  • Enhanced UI data binding and simplified view structure for better performance

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
View.cs Updated event handling from DetachedFromLogicalTree to Unloaded event
NavigationFrame.cs Refactored duplicate activation logic into reusable helper method
ConventionManager.cs Added ListBox element convention for Avalonia platform
ActionMessage.cs Removed commented code for cleaner implementation
ScreenExtentionTests.cs Removed ConfigureAwait(false) calls for consistency
ScreenExtensionsTests.cs Added comprehensive test coverage for screen activation/deactivation
MenuViewModel.cs Changed navigation method from event aggregator to direct navigation service
ConductorViewModel.cs Added async activation lifecycle method
ConductorView.axaml Simplified UI structure and improved data binding patterns
Bootstrapper.cs Improved async handling of root view display
return Task.FromResult(IsClosable);
}

[Obsolete("Use OnActivateAsync instead.")]
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The Obsolete attribute message is incorrect. OnActivateAsync is the method being overridden, not the replacement. The message should indicate what method to use instead.

Suggested change
[Obsolete("Use OnActivateAsync instead.")]
[Obsolete("Use OnActivatedAsync instead.")]

Copilot uses AI. Check for mistakes.

vb2ae and others added 3 commits July 23, 2025 16:07
- Replaced `Panel` with `ContentControl` in `ConductorView.axaml` for better layout handling.
- Changed root element from `Grid` to `StackPanel` in `TabView.axaml`, and updated data binding for `ItemsControl`.
- Added `DataContext` binding convention for `Panel` in `ConventionManager.cs` to enhance data context management.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant