presence/Presence.Desktop/ViewModels/MainWindowViewModel.cs
2024-12-20 12:16:16 +03:00

23 lines
845 B
C#

using System;
using data.RemoteData.RemoteDataBase;
using domain.UseCase;
using Microsoft.Extensions.DependencyInjection;
using ReactiveUI;
namespace Presence.Desktop.ViewModels;
public class MainWindowViewModel : ViewModelBase, IScreen
{
public RoutingState Router { get; } = new RoutingState();
public MainWindowViewModel(IServiceProvider serviceProvider)
{
var groupUseCase = serviceProvider.GetRequiredService<GroupUseCase>();
var presenceUseCase = serviceProvider.GetRequiredService<UseCaseGeneratePresence>();
var remoteDatabaseContext = serviceProvider.GetRequiredService<RemoteDatabaseContext>();
// Передаем все зависимости в GroupViewModel
Router.Navigate.Execute(new GroupViewModel(this, groupUseCase, presenceUseCase, remoteDatabaseContext));
}
}