Retail_manager/RMWPFUserInterface/ViewModels/ShellViewModel.cs

37 lines
1018 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
2022-07-08 16:27:24 +02:00
using Caliburn.Micro;
using RMWPFUserInterface.EventModels;
namespace RMWPFUserInterface.ViewModels
{
public class ShellViewModel : Conductor<Object>, IHandle<LogOnEvent>
{
private IEventAggregator _events;
private SalesViewModel _salesVM;
private SimpleContainer _container;
public ShellViewModel(IEventAggregator events, SalesViewModel salesVM,
SimpleContainer container)
2022-07-08 16:27:24 +02:00
{
_salesVM = salesVM;
_container = container;
_events = events;
_events.SubscribeOnUIThread(this);
ActivateItemAsync(_container.GetInstance<LoginViewModel>());
}
public Task HandleAsync(LogOnEvent message, CancellationToken cancellationToken)
{
ActivateItemAsync(_salesVM);
return Task.CompletedTask;
2022-07-08 16:27:24 +02:00
}
}
}