microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.51k stars 6.45k forks source link

[Settings] Investigate use case of ActivationService and ActivationHandler classes #7647

Open lmawarid opened 3 years ago

lmawarid commented 3 years ago

Summary of the new feature/enhancement

While doing work on #7559, I came across the ActivationService and ActivationHandler classes in the Settings.UI project and wanted to validate threading behavior from changes I made on that PR. In my debugging attempts I was unable to trigger breakpoints and hit the code paths in these classes (both with VS debugging and print statement debugging). We should verify if these classes are actually used, or if they are dead code that can be removed.

Proposed technical implementation details (optional)

The only documentation I can find on these classes (also linked in the source code) is this, which shows that it is in charge of activating a UWP application. However, to my understanding, the Settings app is primarily a WPF app which imports some UI controls and behaviors from UWP (a XAML island - see this doc), so I'm not sure if this activation mechanism would apply here. If not, we should remove these classes and verify that no regressions occur.

lmawarid commented 3 years ago

Update: I asked the Windows Template Studio team and determined that the current application are not using these classes. These are used with the OnLaunched and OnActivated events of UWP apps and we don't have those as a XAML Island.

So they are not necessary as of now and can be removed (but it's unclear if we need them if we migrate to WinUI3).