private void LoadTaskbarIcon(TrayIconViewModel trayVm, AuthenticationDialog authDialog) { trayVm.OnExitApplication += (s, e) => Application.Current.Shutdown(); trayVm.OnAuthenticationRequested += (s, e) => authDialog.Show(); _tb.DataContext = trayVm; _tb?.BringIntoView(); }
protected override void Load(ContainerBuilder builder) { builder.Register(c => TrayIconViewModel.Create(c.Resolve <MatrixApp>())); builder.RegisterType <AuthenticationDialog>().AsSelf().SingleInstance(); builder.RegisterType <AuthenticationDialogViewModel>().AsSelf().SingleInstance(); builder.RegisterType <DialogAuthenticator>().As <IMatrixAuthenticator>().SingleInstance(); }