Skip to content

556 compatibility inquiry avaloniaui #851

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

Merged
merged 169 commits into from
Dec 14, 2024
Merged

Conversation

vb2ae
Copy link
Member

@vb2ae vb2ae commented Apr 2, 2023

Add Avalonia ui support

vb2ae added 6 commits November 7, 2024 22:00
rolled back some changes in viewmodellocator
add NameFormat validation to viewLocator
Added logging statements to various methods in `Screen.cs`,
`ActionMessage.cs`, `NavigationFrame.cs`, and `View.cs` to
log lifecycle events, execution context, content changes,
layout updates, and errors. Moved `elementToUse` assignment
in `ActionMessage.cs` for correct usage. Changed
`NavigationFrame` to inherit from `ContentControl` instead
of `TransitioningContentControl`. Updated `ExecuteOnLoad`
method in `View.cs` to use `Loaded` event for Avalonia.
Modified equality checks in `OnModelChanged` and
`OnContextChanged` methods in `View.cs` to use `==` instead
of `.Equals`. Refactored `SetContentPropertyCore` method in
`View.cs` for readability and added exception logging. Added
new method `GetContentPropertyName` in `View.cs` for
retrieving content property name with improved formatting.
@vb2ae vb2ae requested a review from maxkatz6 November 21, 2024 12:26
@vb2ae vb2ae requested review from maxkatz6 and KasperSK and removed request for maxkatz6 November 30, 2024 20:21
Updated Avalonia-related package references in `Caliburn.Micro.Avalonia.csproj` from version `11.2.0` to `11.2.2`.

Removed unnecessary `using` directives for `Avalonia` and `Avalonia.Controls` in `NavigationFrame.cs`.

Simplified the condition in `NavigationFrame_TransitionCompleted` method to use `object.ReferenceEquals(e.To, e.From)`.
@vb2ae vb2ae requested review from Copilot and removed request for maxkatz6 December 14, 2024 18:39
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.

Copilot reviewed 150 out of 165 changed files in this pull request and generated 2 comments.

Files not reviewed (15)
  • samples/features/Features.Avalonia/App.axaml: Language not supported
  • samples/features/Features.Avalonia/Features.Avalonia.csproj: Language not supported
  • samples/features/Features.Avalonia/Views/ActionsView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/BindingsView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/BubblingView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/ConductorView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/ConductorView.axaml.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Views/BubblingView.axaml.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/TaskHelper.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Lipsum.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Bootstrapper.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Views/BindingsView.axaml.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Results/ResultBase.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Results/VisualStateResult.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Views/ActionsView.axaml.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

samples/features/Features.Avalonia/Program.cs:10

  • [nitpick] The comment on line 10 is informal and unclear. Consider rephrasing it to: 'Initialization code. Avoid using Avalonia, third-party APIs, or any SynchronizationContext-reliant code before AppMain is called, as things aren't initialized yet and may break.'
// Initialization code. Don't use any Avalonia, third-party APIs or any

Enhanced null safety in NavigationFrame.cs by using the null-conditional operator for DataContext access. Simplified type casting in View.cs by directly checking the IsLoaded property of FrameworkElement.
Modified `MessageDialogResult.cs` to use variables `title` and `content` instead of hardcoded strings in `GetMessageBoxStandard` method.

Renamed `OnInitializeAsync` to `OnInitializedAsync` in `ShellViewModel.cs` and updated the base method call accordingly.

Changed instance retrieval in `GoHome` method of `ShellViewModel.cs` to use `_container.GetInstance<MenuViewModel>()` instead of `IoC.GetInstance`.
@vb2ae vb2ae requested a review from Copilot December 14, 2024 19: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.

Copilot reviewed 150 out of 165 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • samples/features/Features.Avalonia/App.axaml: Language not supported
  • samples/features/Features.Avalonia/Features.Avalonia.csproj: Language not supported
  • samples/features/Features.Avalonia/Views/ActionsView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/BindingsView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/BubblingView.axaml: Language not supported
  • samples/features/Features.Avalonia/Views/ConductorView.axaml: Language not supported
  • samples/features/Features.Avalonia/App.axaml.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Bootstrapper.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Lipsum.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Messages/SimpleMessage.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Program.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Results/MessageDialogResult.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Results/ResultBase.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/Results/VisualStateResult.cs: Evaluated as low risk
  • samples/features/Features.Avalonia/TaskHelper.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)

samples/features/Features.Avalonia/Views/ActionsView.axaml.cs:0

  • Ensure that the new behavior introduced by the ActionsView class is covered by tests.
namespace Features.CrossPlatform.Views

samples/features/Features.Avalonia/ViewModels/ShellViewModel.cs:43

  • The cast to INavigationService should be checked for null to avoid potential runtime errors. Consider adding a null check after the cast.
_navigationService = frame as INavigationService;

samples/features/Features.Avalonia/ViewModels/ShellViewModel.cs:32

  • Ensure that the GoHome method is covered by tests, as it contains logic that navigates to a view model.
public void GoHome()

@vb2ae vb2ae merged commit 7e7f64c into master Dec 14, 2024
4 checks passed
@vb2ae vb2ae deleted the 556-compatibility-inquiry-avaloniaui branch December 14, 2024 23:35
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.

Compatibility inquiry - AvaloniaUI?
6 participants