Skip to content

Add StatusCenter - #232

Merged
ghost1372 merged 53 commits into
ghost1372:mainfrom
tinodin:StatusCenter
Nov 21, 2026
Merged

ghost1372 merged 53 commits into
ghost1372:mainfrom
tinodin:StatusCenter

Conversation

@tinodin

@tinodin tinodin commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Original port from Files.

Features / Changes:

  • Ability to create custom actions
  • Ability to change FlyoutPlacement
  • Ability to switch between Size units
  • Ability to change StatusCenterButton icon
  • Ability to change StatusCenterItem icons
  • Ability to Pause and Resume
  • Ability to programmatically open it instead of AccessKey (Alt+T)
  • Aggregated taskbar progress with multiple instances
  • Theme switches work

Corresponding documentation here:
ghost1372/ghost1372.github.io#39

@ghost1372

Copy link
Copy Markdown
Owner

@tinodin, thank you for your work. I’ve taken a look at it, and unfortunately, there are some serious issues. There are several NuGet dependencies that I don't want to introduce, changes to SpeedGraph in an unrelated PR, ViewModel, and so on. Overall, the changes are quite messy and need some cleanup.

  <PackageReference Include="ByteSize" Version="2.1.2" />
    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
    <PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.3.260402-preview2" />
    <PackageReference Include="CommunityToolkit.WinUI.Triggers" Version="8.3.260402-preview2" />
    <PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.3.1" PrivateAssets="all" ExcludeAssets="build;buildTransitive" />

I may close this PR and start a clean implementation based on your work. Alternatively, if you're already working on a revised version, please let me know.

@tinodin

tinodin commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@ghost1372 I knew that the new Nuget packages would maybe be a concern for you. Can you explain how you would like those to be handled and why? ByteSize can be removed alongside the property for size unit. CsWinRT can be removed after removing the [DynamicWindowsRuntimeCast] - the control works fine without those. I don't see any issues for using other CommunityToolkit packages especially since those are really useful and required for advanced controls.

"Unrelated changes":
I had to change SpeedGraph2 for several reasons (its used in StatusCenter):

  1. To match Files in the Accent Colors for normal mode.
  2. To fix a crash when setting graphGeometry.Path = null (instead using visibility)
  3. To fix theme changes not reaching it because it is in a flyout I had to add DPs for each mode.
  4. I had to make the state publically accessible for StatusCenter to keep track of it.

Could you explain what you mean by ViewModel? The control needs its own ViewModel in order to keep its state across the app, there is no other solution and it is what Files does as well.

Other than those changes there is no cleanup / rewrite to make, I made sure that all the ported code remains the same to the original. The parts that are not needed have been isolated and removed.

I do not recommend you starting clean under any circumstances. Please let me know.

@ghost1372

Copy link
Copy Markdown
Owner

@ghost1372 I knew that the new Nuget packages would maybe be a concern for you. Can you explain how you would like those to be handled and why? ByteSize can be removed alongside the property for size unit. CsWinRT can be removed after removing the [DynamicWindowsRuntimeCast] - the control works fine without those. I don't see any issues for using other CommunityToolkit packages especially since those are really useful and required for advanced controls.

"Unrelated changes": I had to change SpeedGraph2 for several reasons (its used in StatusCenter):

  1. To match Files in the Accent Colors for normal mode.
  2. To fix a crash when setting graphGeometry.Path = null (instead using visibility)
  3. To fix theme changes not reaching it because it is in a flyout I had to add DPs for each mode.
  4. I had to make the state publically accessible for StatusCenter to keep track of it.

Could you explain what you mean by ViewModel? The control needs its own ViewModel in order to keep its state across the app, there is no other solution and it is what Files does as well.

Other than those changes there is no cleanup / rewrite to make, I made sure that all the ported code remains the same to the original. The parts that are not needed have been isolated and removed.

I do not recommend you starting clean under any circumstances. Please let me know.

Some of these dependencies can be replaced with our existing helpers, such as ByteSize → FileHelper.GetFileSize(long).

CSWinRT is only being used for DynamicWindowsRuntimeCast, as you mentioned, so it's not necessary.

As for CommunityToolkit, it only increases the package size, and I don't want to introduce it as a dependency for a single control. They tend to be slow with updates, and we could run into compatibility issues whenever there's a major update, such as a new SDK release. I've experienced this before, where we ended up being blocked until they updated their packages. So I'd rather avoid that dependency altogether.

I'm fine with using SpeedGraph in StatusCenter, but I'd prefer to track it in a separate PR. That way, we can review and handle any potential issues independently without affecting the main implementation.

One more thing: I noticed that you're exposing the ViewModel class and requiring users to interact with it to make the control work. Instead, we should implement this as a TemplatedControl that handles everything internally, without requiring users to manage or interact with a ViewModel.
Files mostly uses UserControl because it's an application, and they don't need to worry much about reusability since they're the only ones using those controls. But we're building a library, so we need to take a different approach and make our controls reusable, flexible, and easy to integrate into different applications.

Also, there are a few other issues worth addressing, such as the following, We don't need this; our XamlTools already handles it automatically:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterInfoBadgeStyles.xaml" />
    <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterStyles.xaml" />
</ResourceDictionary.MergedDictionaries>

@tinodin

tinodin commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Some of these dependencies can be replaced with our existing helpers, such as ByteSize → FileHelper.GetFileSize(long).

Yes it can be done, should I change it (but it would require modifying FileHelper.cs to support binary units ca. 20 lines).

CSWinRT is only being used for DynamicWindowsRuntimeCast, as you mentioned, so it's not necessary.

Yep.

As for CommunityToolkit, it only increases the package size, and I don't want to introduce it as a dependency for a single control. They tend to be slow with updates, and we could run into compatibility issues whenever there's a major update, such as a new SDK release. I've experienced this before, where we ended up being blocked until they updated their packages. So I'd rather avoid that dependency altogether.

Fair enough although the size difference would be negligible. The converters used already exist locally the other packages can be replaced as well. Personally I think CommunityToolkit.Mvvm is great but alright.

I'm fine with using SpeedGraph in StatusCenter, but I'd prefer to track it in a separate PR. That way, we can review and handle any potential issues independently without affecting the main implementation.

I saw you modified it recently to make resizing work. It was essentially ported from files too, without the license header (you may wanna add it). I think it wouldn't make sense to open a separate PR just for it because its a single file and finishing StatusCenter without it would not make sense as you would have no way easy way to verify the theme changing works. I have looked into other approaches to make it work but all of them made kind of no sense.

One more thing: I noticed that you're exposing the ViewModel class and requiring users to interact with it to make the control work. Instead, we should implement this as a TemplatedControl that handles everything internally, without requiring users to manage or interact with a ViewModel.
Files mostly uses UserControl because it's an application, and they don't need to worry much about reusability since they're the only ones using those controls. But we're building a library, so we need to take a different approach and make our controls reusable, flexible, and easy to integrate into different applications.

Thanks for that tip, I will look into it.

Also, there are a few other issues worth addressing, such as the following, We don't need this; our XamlTools already handles it automatically:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterInfoBadgeStyles.xaml" />
    <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterStyles.xaml" />
</ResourceDictionary.MergedDictionaries>

Only <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterStyles.xaml" /> can be removed because StatusCenterButton doesn't reference any of its keys — the StatusCenter control in the flyout merges that file itself. <ResourceDictionary Source="ms-appx:///DevWinUI/Controls/Ported/StatusCenter/Styles/StatusCenterInfoBadgeStyles.xaml" /> has to stay, since StatusCenterButton's own visual states use SuccessIconInfoBadgeStyle, CautionValueInfoBadgeStyle, and CriticalIconInfoBadgeStyle from it; because that file isn't combined into Generic.xaml, the local merge is the only place those lookups can resolve. Keeping both files out of Generic.xaml also avoids leaking the ToggleButton* overrides app-wide.

@ghost1372

Copy link
Copy Markdown
Owner

I’ve cleaned up most of it, but there are still a few issues. You can take it from here! :)

App5.zip

@tinodin

tinodin commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@ghost1372 The actions don't seem to work at all. It also crashes.

@tinodin

tinodin commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I know the build times are long but I would not recommend using a test app project. Especially since this changed all of the code. You won't match the original design ever. 👎

@ghost1372

Copy link
Copy Markdown
Owner

Yes, it has some issues, but it's a starting point. I always work this way :) It's faster, and I'll polish and finalize everything in the end. All controls are created this way. Don't worry about the styles; I'll rename those ToggleSwitch resources so nothing breaks.

@tinodin

tinodin commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

The issue is not that its a test app project, it's that you started from scratch essentially. That's why there are all these issues. I won't work at this (its too much work for nothing, too time consuming). I will be happy to fix all your concerns with the code I had worked on for weeks.

@ghost1372

Copy link
Copy Markdown
Owner

The issue is not that its a test app project, it's that you started from scratch essentially. That's why there are all these issues. I won't work at this (its too much work for nothing, too time consuming). I will be happy to fix all your concerns with the code I had.

Actually, it's your code that I modified. Ok, that's fair enough. There's no rush anyway. I'll wait.

@tinodin

tinodin commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Any updates @ghost1372 ?

@ghost1372

ghost1372 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Any updates @ghost1372 ?

I requested a few changes 3 days ago, so I'm waiting for your fixes. Didn't you receive the review request?

image

@tinodin

tinodin commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@ghost1372 I indeed can't see them. You have to submit the review I think.

@ghost1372

Copy link
Copy Markdown
Owner

@tinodin Sorry, it's because of GitHub's stupid new overview page. I didn't notice that button until now.

Screenshot_۲۰۲۶۱۱۲۰_۲۱۳۶۳۲_Chrome

@ghost1372

Copy link
Copy Markdown
Owner

@tinodin can you confirm you can see requests?

@tinodin
tinodin requested a review from ghost1372 November 20, 2026 21:55
@tinodin
tinodin requested a review from ghost1372 November 21, 2026 12:24
@ghost1372

Copy link
Copy Markdown
Owner

Thank you @tinodin

@ghost1372
ghost1372 merged commit 10b7ebf into ghost1372:main Nov 21, 2026
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