Skip to content

Commit

Permalink
feat(desktop): Switch top level view models to singleton lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
VMelnalksnis committed Feb 10, 2024
1 parent 0e2e006 commit 8903f3a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
9 changes: 7 additions & 2 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ <h3>Added</h3>
<ul></ul>
</section>

<section id="unreleased_changed" hidden="hidden">
<section id="unreleased_changed">
<h3>Changed</h3>
<ul></ul>
<ul>
<li>
Preserve state from current run for each application view in
<a href="https://github.com/VMelnalksnis/Gnomeshade/pull/1081">#1081</a>
</li>
</ul>
</section>

<section id="unreleased_deprecated" hidden="hidden">
Expand Down
44 changes: 22 additions & 22 deletions source/Gnomeshade.Avalonia.Core/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ public static class ServiceCollectionExtensions
/// <returns><paramref name="serviceCollection"/>.</returns>
public static IServiceCollection AddViewModels(this IServiceCollection serviceCollection) => serviceCollection
.AddSingleton<MainWindowViewModel>()
.AddTransient<ConfigurationWizardViewModel>()
.AddTransient<GnomeshadeConfigurationViewModel>()
.AddTransient<AuthenticationConfigurationViewModel>()
.AddTransient<UserConfigurationWriter>()
.AddTransient<LoginViewModel>()
.AddTransient<ApplicationSettingsViewModel>()
.AddTransient<CounterpartyMergeViewModel>()
.AddTransient<CategoryViewModel>()
.AddTransient<AccountViewModel>()
.AddTransient<CounterpartyViewModel>()
.AddTransient<ImportViewModel>()
.AddTransient<ProductViewModel>()
.AddTransient<UnitViewModel>()
.AddTransient<CategoryReportViewModel>()
.AddTransient<BalanceReportViewModel>()
.AddTransient<ProductReportViewModel>()
.AddTransient<PreferencesViewModel>()
.AddTransient<TransactionViewModel>()
.AddTransient<OwnerViewModel>()
.AddTransient<OwnerUpsertionViewModel>()
.AddTransient<AboutViewModel>()
.AddTransient<LicensesViewModel>();
.AddSingleton<ConfigurationWizardViewModel>()
.AddSingleton<GnomeshadeConfigurationViewModel>()
.AddSingleton<AuthenticationConfigurationViewModel>()
.AddSingleton<UserConfigurationWriter>()
.AddSingleton<LoginViewModel>()
.AddSingleton<ApplicationSettingsViewModel>()
.AddSingleton<CounterpartyMergeViewModel>()
.AddSingleton<CategoryViewModel>()
.AddSingleton<AccountViewModel>()
.AddSingleton<CounterpartyViewModel>()
.AddSingleton<ImportViewModel>()
.AddSingleton<ProductViewModel>()
.AddSingleton<UnitViewModel>()
.AddSingleton<CategoryReportViewModel>()
.AddSingleton<BalanceReportViewModel>()
.AddSingleton<ProductReportViewModel>()
.AddSingleton<PreferencesViewModel>()
.AddSingleton<TransactionViewModel>()
.AddSingleton<OwnerViewModel>()
.AddSingleton<OwnerUpsertionViewModel>()
.AddSingleton<AboutViewModel>()
.AddSingleton<LicensesViewModel>();
}

0 comments on commit 8903f3a

Please sign in to comment.