using Demo.Domain.UseCase; using Microsoft.Extensions.DependencyInjection; using ReactiveUI; using System; using System.Reactive; namespace Presence.Desktop.ViewModels { public class StartViewModel : ViewModelBase, IRoutableViewModel { public IScreen HostScreen { get; } public string? UrlPathSegment => "start"; public ReactiveCommand OpenGroupCommand { get; } public ReactiveCommand OpenPresenceCommand { get; } public ReactiveCommand GoBackCommand { get; } public StartViewModel(IScreen hostScreen) { HostScreen = hostScreen; OpenGroupCommand = ReactiveCommand.Create(() => { HostScreen.Router.Navigate.Execute(new GroupViewModel( App.ServiceProvider.GetRequiredService(), App.ServiceProvider.GetRequiredService(), HostScreen )); }); OpenPresenceCommand = ReactiveCommand.Create(() => { HostScreen.Router.Navigate.Execute(new PresenceViewModel(HostScreen)); }); GoBackCommand = ReactiveCommand.Create(() => { HostScreen.Router.Navigate.Execute(new StartViewModel(HostScreen)); }); } } }