-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add ReactiveUI navigation behaviors library #83
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
Add ReactiveUI navigation behaviors library #83
Conversation
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 introduces the new Avalonia.ReactiveUI.Navigation project to support reactive UI navigation behaviors and updates the solution and related projects to wire it up.
- Added new ReactiveUI navigation actions: NavigateToViewModelAction and NavigateBackAction.
- Updated project files (csproj and sln) to include and reference the new navigation project.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xaml.Behaviors/Xaml.Behaviors.csproj | Added new property and compile inclusion for ReactiveUI navigation sources. |
| src/Avalonia.Xaml.Behaviors/Avalonia.Xaml.Behaviors.csproj | Added a project reference to the new navigation project. |
| src/Avalonia.ReactiveUI.Navigation/Properties/AssemblyInfo.cs | Added assembly attributes for InternalsVisibleTo and XML namespace definition. |
| src/Avalonia.ReactiveUI.Navigation/NavigateToViewModelAction.cs | Introduced an action to navigate using a provided or parameterized view model. |
| src/Avalonia.ReactiveUI.Navigation/NavigateBackAction.cs | Introduced an action to navigate back in the routing stack. |
| src/Avalonia.ReactiveUI.Navigation/Avalonia.ReactiveUI.Navigation.csproj | Created the project file targeting multiple frameworks with package setup. |
| AvaloniaBehaviors.sln | Updated solution to include the new ReactiveUI navigation project. |
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
Adds a new ReactiveUI navigation behaviors library and wires it into the solution.
- Introduces
NavigateToViewModelActionandNavigateBackActionfor ReactiveUI routing in XAML. - Registers a new
Avalonia.Xaml.Interactions.ReactiveUIproject and updates package/version management. - Updates solution and directory props to include the new project and ReactiveUI dependency.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Avalonia.Xaml.Interactions.ReactiveUI/Properties/AssemblyInfo.cs | Exposes internals and defines XML namespace |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateToViewModelAction.cs | Implements navigation-to-viewmodel action |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs | Implements navigation-back action |
| src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj | Defines new ReactiveUI interactions library project |
| Directory.Packages.props | Adds ReactiveUI version pin |
| AvaloniaBehaviors.sln | Includes new project in the solution |
Comments suppressed due to low confidence (6)
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateToViewModelAction.cs:5
- Typo in namespace 'ReractiveUI'; rename to 'ReactiveUI' to match project and folder naming.
namespace Avalonia.Xaml.Interactions.ReractiveUI;
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs:5
- Typo in namespace 'ReractiveUI'; rename to 'ReactiveUI' to match project and folder naming.
namespace Avalonia.Xaml.Interactions.ReractiveUI;
src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj:8
- RootNamespace has typo 'ReractiveUI'; update to 'ReactiveUI' to align with package and code structure.
<RootNamespace>Avalonia.Xaml.Interactions.ReractiveUI</RootNamespace>
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateToViewModelAction.cs:48
- Add unit tests for NavigateToViewModelAction covering enabled/disabled states and null ViewModel or parameter scenarios to ensure correct behavior.
public override object Execute(object? sender, object? parameter)
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs:33
- Add unit tests for NavigateBackAction to cover cases when the navigation stack is empty and when it contains entries.
public override object Execute(object? sender, object? parameter)
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateToViewModelAction.cs:1
- The using directive 'using Avalonia.Reactive' doesn't match an existing namespace; likely intended 'using System.Reactive' or can be removed if unused.
using Avalonia.Reactive;
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateToViewModelAction.cs
Outdated
Show resolved
Hide resolved
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs
Outdated
Show resolved
Hide resolved
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
Adds a new Avalonia.ReactiveUI.Navigation library for ReactiveUI-based navigation behaviors and wires it into the solution and package management.
- Introduces five actions (
NavigateAction,NavigateAndReset,NavigateBackAction,ClearNavigationStackAction) in a new project - Updates solution, project file, and package props to include the new library
- Adds assembly attributes for internals visibility and XML namespace mapping
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Avalonia.Xaml.Interactions.ReactiveUI/Properties/AssemblyInfo.cs | Added InternalsVisibleTo and XmlnsDefinition attributes |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs | Implemented NavigateBackAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAction.cs | Implemented NavigateAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAndReset.cs | Implemented NavigateAndReset action |
| src/Avalonia.Xaml.Interactions.ReactiveUI/ClearNavigationStackAction.cs | Implemented ClearNavigationStackAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj | New project file for ReactiveUI navigation behaviors |
| Directory.Packages.props | Added ReactiveUI package version |
| AvaloniaBehaviors.sln | Included the new project in the solution |
Comments suppressed due to low confidence (1)
src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj:8
- Correct the RootNamespace to 'Avalonia.Xaml.Interactions.ReactiveUI' to match project conventions and code namespaces.
<RootNamespace>Avalonia.Xaml.Interactions.ReractiveUI</RootNamespace>
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs
Outdated
Show resolved
Hide resolved
src/Avalonia.Xaml.Interactions.ReactiveUI/ClearNavigationStackAction.cs
Outdated
Show resolved
Hide resolved
src/Avalonia.Xaml.Interactions.ReactiveUI/ClearNavigationStackAction.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…Action.cs Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…Action.cs Co-authored-by: Copilot <[email protected]>
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
Adds a new Avalonia.ReactiveUI.Navigation library to provide XAML actions for ReactiveUI routing and wires it into the solution and package management.
- Introduces assembly metadata and XML namespace for the ReactiveUI interactions library
- Implements four
StyledElementActionclasses: navigation, back, reset, and clear-stack - Updates project files (csproj, Directory.Packages.props, solution) to include the new library
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Avalonia.Xaml.Interactions.ReactiveUI/Properties/AssemblyInfo.cs | Expose internals to tests and register XML namespace |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs | Added NavigateBackAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAndReset.cs | Added NavigateAndReset action class |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAction.cs | Added NavigateAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/ClearNavigationStackAction.cs | Added ClearNavigationStackAction |
| src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj | New project for ReactiveUI interactions |
| Directory.Packages.props | Added ReactiveUI package version |
| AvaloniaBehaviors.sln | Included new project in solution |
Comments suppressed due to low confidence (2)
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAndReset.cs:10
- [nitpick] For consistency with other action classes, consider renaming this to 'NavigateAndResetAction'.
public class NavigateAndReset : StyledElementAction
src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs:33
- This action has no unit tests; consider adding tests for the Execute method in both enabled/disabled and empty-stack scenarios.
public override object Execute(object? sender, object? parameter)
src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj
Outdated
Show resolved
Hide resolved
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 introduces a new ReactiveUI navigation behaviors library to enable navigation actions for Avalonia applications.
- Added a new project, Avalonia.ReactiveUI.Navigation, containing navigation actions.
- Implemented NavigateBackAction, NavigateAndReset, NavigateAction, and ClearNavigationStackAction classes for various navigation functionalities.
- Updated the solution file and package references to incorporate the new project.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Avalonia.Xaml.Interactions.ReactiveUI/Properties/AssemblyInfo.cs | Adds assembly attributes for unit testing and XAML namespace definitions. |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateBackAction.cs | Introduces navigation back action using ReactiveUI commands. |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAndReset.cs | Implements a navigation action that resets the navigation stack with support for view model selection. |
| src/Avalonia.Xaml.Interactions.ReactiveUI/NavigateAction.cs | Implements a navigation action for navigating to a provided view model. |
| src/Avalonia.Xaml.Interactions.ReactiveUI/ClearNavigationStackAction.cs | Provides an action to clear the navigation stack. |
| src/Avalonia.Xaml.Interactions.ReactiveUI/Avalonia.Xaml.Interactions.ReactiveUI.csproj | Sets up the new project with appropriate target frameworks and package references. |
| Directory.Packages.props | Updates the ReactiveUI package version. |
| AvaloniaBehaviors.sln | Adds the new project to the solution. |
Summary
Avalonia.ReactiveUI.Navigationproject containing navigation actionsTesting
dotnet test --configuration Release(fails:dotnet: command not found)