Skip to content

Code quality: Use RelayCommand instead of creating ICommand and add GlobalUsings#1203

Open
ChenYiLins wants to merge 2 commits intoAutoDarkMode:v11.1from
ChenYiLins:codequality-relayCommand
Open

Code quality: Use RelayCommand instead of creating ICommand and add GlobalUsings#1203
ChenYiLins wants to merge 2 commits intoAutoDarkMode:v11.1from
ChenYiLins:codequality-relayCommand

Conversation

@ChenYiLins
Copy link
Copy Markdown
Member

Description

  • Use RelayCommand instead of creating ICommand yourself. There is no performance improvement, but it will be more convenient and easy to use.
    Sample code for RelayCommand:
[RelayCommand]
private void CheckUpdate()
{
    xxx;
}
  • Add global using, but be restrained to prevent namespace conflicts.

For reviewers:

In order to facilitate the review, there is no substantial change in the code of this PR, but only changes ICommand into RelayCommand, and then cleans up the code after adding GlobalUsings.

@ChenYiLins ChenYiLins added this to the Version 11.x milestone Mar 11, 2026
@ChenYiLins ChenYiLins requested a review from Armin2208 as a code owner March 11, 2026 13:55
@ChenYiLins ChenYiLins requested review from a team and Spiritreader as code owners March 11, 2026 13:55
@ChenYiLins ChenYiLins added the area-winui3 Issues for winui3, version 11 or later label Mar 11, 2026
@Jay-o-Way Jay-o-Way added framework Related to the underlying framework, including .NET or the UI framework used and removed area-winui3 Issues for winui3, version 11 or later labels Mar 11, 2026
}


private async Task GetAutostartInfo(bool toggleVisibility = true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework Related to the underlying framework, including .NET or the UI framework used

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants