presence/Presence.Desktop/ViewModels/MainWindowViewModel.cs

23 lines
845 B
C#
Raw Normal View History

2024-12-18 07:19:58 +00:00
using System;
2024-12-20 09:16:16 +00:00
using data.RemoteData.RemoteDataBase;
2024-12-18 08:42:44 +00:00
using domain.UseCase;
2024-12-18 07:19:58 +00:00
using Microsoft.Extensions.DependencyInjection;
2024-12-02 10:04:59 +00:00
using ReactiveUI;
2024-11-24 18:05:17 +00:00
2024-12-18 07:19:58 +00:00
namespace Presence.Desktop.ViewModels;
2024-12-16 04:10:04 +00:00
2024-12-18 07:19:58 +00:00
public class MainWindowViewModel : ViewModelBase, IScreen
{
public RoutingState Router { get; } = new RoutingState();
2024-12-16 04:10:04 +00:00
2024-12-18 07:19:58 +00:00
public MainWindowViewModel(IServiceProvider serviceProvider)
{
2024-12-18 08:42:44 +00:00
var groupUseCase = serviceProvider.GetRequiredService<GroupUseCase>();
2024-12-20 09:16:16 +00:00
var presenceUseCase = serviceProvider.GetRequiredService<UseCaseGeneratePresence>();
var remoteDatabaseContext = serviceProvider.GetRequiredService<RemoteDatabaseContext>();
2024-12-18 08:42:44 +00:00
2024-12-20 09:16:16 +00:00
// Передаем все зависимости в GroupViewModel
Router.Navigate.Execute(new GroupViewModel(this, groupUseCase, presenceUseCase, remoteDatabaseContext));
2024-11-24 18:05:17 +00:00
}
2024-12-20 09:16:16 +00:00
}