Created
July 17, 2019 20:36
-
-
Save Veretax/0d018ed300cae64b6c4ed346c0b3987d to your computer and use it in GitHub Desktop.
Runtime debugging that skips login validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Caliburn.Micro; | |
using TRMDesktopUI.EventModels; | |
namespace TRMDesktopUI.ViewModels | |
{ | |
public class ShellViewModel : Conductor<object>, IHandle<LogOnEvent>, IHandle<string> | |
{ | |
private SalesViewModel _salesVM; | |
private IEventAggregator _events; | |
private SimpleContainer _container; | |
public ShellViewModel(IEventAggregator events, SalesViewModel salesVM, SimpleContainer container) | |
{ | |
_events = events; | |
_salesVM = salesVM; | |
_container = container; | |
_events.Subscribe(this); | |
if (Debugger.IsAttached) | |
{ | |
ActivateItem(_container.GetInstance<SalesViewModel>()); | |
} | |
else | |
{ | |
ActivateItem(_container.GetInstance<LoginViewModel>()); | |
} | |
} | |
public void Handle(LogOnEvent message) | |
{ | |
ActivateItem(_salesVM); | |
} | |
public void Handle(string message) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment