29 lines
736 B
C#
29 lines
736 B
C#
using System;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Policlinica.ViewModels;
|
|
|
|
public partial class StartViewModel:ViewModelBase
|
|
{
|
|
private readonly Navigation _navigation;
|
|
[ObservableProperty] private ViewModelBase _currentPage;
|
|
|
|
public StartViewModel(IServiceProvider sv, Navigation navigation)
|
|
{
|
|
_navigation = navigation;
|
|
_navigation.SetCurrentView(this);
|
|
_navigation.Navigate(sv.GetRequiredService<AutorizationViewModel>());
|
|
}
|
|
|
|
Action closeAction;
|
|
public void SetClose(Action closeAction)
|
|
{
|
|
this.closeAction = closeAction;
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
this.closeAction?.Invoke();
|
|
}
|
|
} |