mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
CmdPal: Add a viewmodel factory for pages (#40504)
_targets #40482_ ref #40113 A smaller refactor, to be sure. This just moves the instantiation of PageViewModel objects out of the ShellViewModel, and into its own class. The idea being that other page types could be added, just by extending that factory (or implementing your own), and then also handling those new VMs in your ShellPage.xaml.cs equivalent.
This commit is contained in:
@@ -149,6 +149,7 @@ public partial class App : Application
|
||||
|
||||
// ViewModels
|
||||
services.AddSingleton<ShellViewModel>();
|
||||
services.AddSingleton<IPageViewModelFactoryService, PageViewModelFactory>();
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user