Skip to content
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

Refactor ViewModel fields and add XML documentation #937

Merged
merged 4 commits into from
Dec 15, 2024

Conversation

vb2ae
Copy link
Member

@vb2ae vb2ae commented Dec 15, 2024

This pull request includes various changes across multiple files to improve code quality, fix issues, and add documentation. The most important changes include suppressing warnings, fixing field initialization, and adding documentation comments.

Suppressing Warnings

Field Initialization Fixes

Adding Documentation Comments

Code Simplification and Refactoring

Closes #936, #879, #880, #883, #938

- Added pragma directive in `ShellViewModel.cs` to suppress CS8618 warning for `_navigationService`.
- Changed `_output` initialization in `ActionsViewModel.cs`.
- Renamed `text` to `_text` and updated `Text` property in `EventSourceViewModel.cs`.
- Added constructor to initialize `_text` in `NavigationTargetViewModel.cs`.
- Added pragma directives in `ScreenExtentionTests.cs` to handle CS0618 warning, and updated `OnActivateAsync` and `OnActivatedAsync` methods.
- Renamed private fields and added XML documentation in `WindowConductor.cs`. Changed `Deactivated` method return type to `Task<bool>`.
- Removed unused code and added XML documentation in `TriggerAction.cs`.
- Added more XML documentation in `WindowConductor.cs` for window event handling and lifecycle methods.
@vb2ae vb2ae linked an issue Dec 15, 2024 that may be closed by this pull request
- Added `[Obsolete]` attribute to `OnActivateAsync` in `ConductorWithCollectionOneActiveTests.cs` to indicate it should be replaced by `OnActivatedAsync`.
- Introduced new `OnActivatedAsync` method in `ConductorWithCollectionOneActiveTests.cs`.
- Corrected spacing and formatting issues in `ConductorWithCollectionOneActiveTests.cs` for better readability.
- Added a summary comment to `BootstrapperBase` class in `BootstrapperBase.cs`.
- Made minor formatting adjustments in `BootstrapperBase.cs`.
- Removed unnecessary `#pragma` directives and added `[Obsolete]` attribute in `ScreenExtentionTests.cs`.
- Skipped a test in `ConductorWithCollectionOneActiveTests.cs` with `[Fact(Skip = "...")]` attribute, providing a reason for skipping.
@vb2ae vb2ae requested a review from Copilot December 15, 2024 20:18

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 13 changed files in this pull request and generated no comments.

Files not reviewed (8)
  • samples/features/Features.Avalonia/ViewModels/ShellViewModel.cs: Evaluated as low risk
  • samples/features/Features.CrossPlatform.Shared/ViewModels/ActionsViewModel.cs: Evaluated as low risk
  • samples/features/Features.CrossPlatform.Shared/ViewModels/Events/EventSourceViewModel.cs: Evaluated as low risk
  • src/Caliburn.Micro.Platform/Platforms/netcore-avalonia/WindowConductor.cs: Evaluated as low risk
  • src/Caliburn.Micro.Platform/Platforms/netcore-avalonia/TriggerAction.cs: Evaluated as low risk
  • src/Caliburn.Micro.Platform/Platforms/netcore-avalonia/BootstrapperBase.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core/SimpleContainer.cs: Evaluated as low risk
  • src/Caliburn.Micro.Platform/Platforms/net46-netcore/WindowConductor.cs: Evaluated as low risk
Copy link

@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.

Copilot reviewed 5 out of 14 changed files in this pull request and generated 1 comment.

Files not reviewed (9)
  • src/Caliburn.Micro.Avalonia/Caliburn.Micro.Avalonia.csproj: Language not supported
  • samples/features/Features.Avalonia/ViewModels/ShellViewModel.cs: Evaluated as low risk
  • samples/features/Features.CrossPlatform.Shared/ViewModels/ActionsViewModel.cs: Evaluated as low risk
  • samples/features/Features.CrossPlatform.Shared/ViewModels/Events/EventSourceViewModel.cs: Evaluated as low risk
  • samples/features/Features.CrossPlatform.Shared/ViewModels/NavigationTargetViewModel.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/ConductorWithCollectionOneActiveTests.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/ScreenExtentionTests.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core/SimpleContainer.cs: Evaluated as low risk
  • src/Caliburn.Micro.Platform.Core/StringSplitter.cs: Evaluated as low risk

@vb2ae vb2ae merged commit 664e243 into master Dec 15, 2024
4 checks passed
@vb2ae vb2ae deleted the 936-fix-build-warnings branch December 15, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant