-
Notifications
You must be signed in to change notification settings - Fork 774
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
base: master
Are you sure you want to change the base?
Conversation
- 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.
- 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>
…o/Caliburn.Micro into bug/AvaloniaUI/968
There was a problem hiding this 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
toUnloaded
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.")] |
There was a problem hiding this comment.
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.
[Obsolete("Use OnActivateAsync instead.")] | |
[Obsolete("Use OnActivatedAsync instead.")] |
Copilot uses AI. Check for mistakes.
- 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>
Bootstrapper.cs
to callInitialize()
after setting up the container and improved root view display with async handling.ConductorView.axaml
by changingx:Name
toName
, removing nested elements, and introducing a newPanel
for better data binding.ConductorViewModel.cs
for improved lifecycle management while retaining tab addition functionality.ShowFeature
inMenuViewModel.cs
for asynchronous navigation to feature view models.ScreenExtenstionsTests.cs
to validate activation and deactivation of screens and conductors.NavigationFrame.cs
to async methods for better responsiveness during navigation events.Closing #968