Skip to content

Conversation

@zdpcdt
Copy link
Collaborator

@zdpcdt zdpcdt commented Sep 19, 2025

This pull request primarily refactors how value converters are referenced and registered in XAML files, moving from CLR/using namespaces to URI-based XML namespaces and consolidating converter registration. It also removes unused or redundant converter implementations in favor of shared or updated ones, and updates the package reference for Irihi.Avalonia.Shared. These changes improve maintainability, consistency, and integration with shared resources.

Converter Refactoring and Namespace Updates:

  • All XAML files now use the https://irihi.tech/semi XML namespace (aliased as semi) for referencing converters, replacing previous clr-namespace or using references. This includes updating all converter usages in Carousel.axaml, ProgressBar.axaml, and SemiPopupAnimations.axaml. [1] [2] [3] [4] [5] [6] [7] [8]

  • The assembly info now adds a new XML namespace definition for Semi.Avalonia.Converters under https://irihi.tech/semi, making all converters in that namespace accessible via the URI.

Converter Implementation Updates:

  • The custom KeyToPathConverter and TreeViewItemIndentConverter implementations have been removed from the codebase, and their usages in XAML replaced with shared or alternative converters (e.g., ResourceConverter). [1] [2] [3] [4]

  • PlacementToRenderTransformOriginConverter and PositionToAngleConverter have been refactored to inherit from MarkupValueConverter (from Irihi.Avalonia.Shared.Converters) and simplified using C# switch expressions. [1] [2]

Dependency and Project File Updates:

  • The project now references Irihi.Avalonia.Shared version 0.3.1 (up from 0.3.0), and removes the now-unused KeyToPathConverter.cs from compilation.

Avalonia XAML Resource Updates:

  • XAML resources in ManagedFileChooser.axaml now use the iri namespace and ResourceConverter for icon resources, aligning with the new converter and namespace conventions. [1] [2]

These changes collectively modernize and standardize how converters are used and referenced throughout the project, leveraging shared resources and simplifying maintenance.

@zdpcdt zdpcdt requested a review from Copilot September 19, 2025 07:20
Copy link

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 pull request modernizes XAML namespace usage by replacing CLR/using namespace references with URI-based XML namespaces for value converters, and consolidates converter registration under the https://irihi.tech/semi namespace. The changes also remove redundant converter implementations and update the shared library dependency.

  • Replace CLR namespace references with URI-based XML namespace (https://irihi.tech/semi) for all converter usages
  • Remove unused converter implementations (KeyToPathConverter, TreeViewItemIndentConverter) and refactor existing converters to inherit from MarkupValueConverter
  • Update Irihi.Avalonia.Shared package reference from version 0.3.0 to 0.3.1

Reviewed Changes

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

Show a summary per file
File Description
Semi.Avalonia.csproj Updates package reference and excludes removed converter from compilation
AssemblyInfo.cs Adds XML namespace definition for Semi.Avalonia.Converters
TreeViewItemIndentConverter.cs Removes unused converter implementation
PositionToAngleConverter.cs Refactors to inherit from MarkupValueConverter with simplified logic
PlacementToRenderTransformOriginConverter.cs Refactors to inherit from MarkupValueConverter and uses switch expressions
KeyToPathConverter.cs Removes unused converter implementation
TreeView.axaml Updates namespace reference for converters
ProgressBar.axaml Replaces namespace references and converter usage with new URI-based approach
ManagedFileChooser.axaml Updates namespace references and replaces KeyToPathConverter with ResourceConverter
Carousel.axaml Updates namespace reference from CLR to URI-based
SemiPopupAnimations.axaml Updates converter reference to use new namespace and removes static instance
Comments suppressed due to low confidence (1)

src/Semi.Avalonia/Converters/PlacementToRenderTransformOriginConverter.cs:1

  • The ConvertBack method was removed from PlacementToRenderTransformOriginConverter but the method signature is still present. This converter works with PlacementMode enum values, not numeric values, so ConvertBack should either throw NotImplementedException or be removed entirely.
using System;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zdpcdt zdpcdt marked this pull request as ready for review September 19, 2025 07:21
@zdpcdt zdpcdt requested a review from rabbitism September 19, 2025 07:21
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.

2 participants