Retail_manager/RMWPFUserInterface/ViewModels/ShellViewModel.cs
s459315 2b2897e128 Replace Container reference in shellViewModel
Replaced container reference with IoC instead
2022-07-24 00:08:22 +02:00

35 lines
923 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Caliburn.Micro;
using RMWPFUserInterface.EventModels;
namespace RMWPFUserInterface.ViewModels
{
public class ShellViewModel : Conductor<Object>, IHandle<LogOnEvent>
{
private IEventAggregator _events;
private SalesViewModel _salesVM;
public ShellViewModel(IEventAggregator events, SalesViewModel salesVM,
SimpleContainer container)
{
_salesVM = salesVM;
_events = events;
_events.SubscribeOnUIThread(this);
ActivateItemAsync(IoC.Get<LoginViewModel>());
}
public Task HandleAsync(LogOnEvent message, CancellationToken cancellationToken)
{
ActivateItemAsync(_salesVM);
return Task.CompletedTask;
}
}
}