Exemplo n.º 1
0
      /// <summary>
      /// Initializes the singleton application object.  This is the first line of authored code
      /// executed, and as such is the logical equivalent of main() or WinMain().
      /// </summary>
      public App()
      {
          // Setup DI
          IServiceCollection serviceCollection = new ServiceCollection();

          serviceCollection.AddApplication();
          serviceCollection.AddInfrastructureCommon();
          serviceCollection.AddInfrastructureKeePass();
          serviceCollection.AddInfrastructureUwp();
          serviceCollection.AddWin81App();
          Services = serviceCollection.BuildServiceProvider();

          _mediator     = Services.GetService <IMediator>();
          _resource     = Services.GetService <IResourceProxy>();
          _settings     = Services.GetService <ISettingsProxy>();
          _navigation   = Services.GetService <INavigationService>();
          _notification = Services.GetService <INotificationService>();
          _log          = Services.GetService <ILogger>();
          _hockey       = Services.GetService <IHockeyClient>();
          _file         = Services.GetService <IFileProxy>();
          _messenger    = Services.GetService <IMessenger>();

          InitializeComponent();
          Suspending         += OnSuspending;
          Resuming           += OnResuming;
          UnhandledException += OnUnhandledException;

          _messenger.Register <SaveErrorMessage>(this, async message => await HandleSaveError(message));
      }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Setup DI
            IServiceCollection serviceCollection = new ServiceCollection();

            serviceCollection.AddApplication();
            serviceCollection.AddInfrastructureCommon();
            serviceCollection.AddInfrastructureKeePass();
            serviceCollection.AddInfrastructureUwp();
            serviceCollection.AddWin10App();
            Services = serviceCollection.BuildServiceProvider();

            _mediator     = Services.GetService <IMediator>();
            _resource     = Services.GetService <IResourceProxy>();
            _settings     = Services.GetService <ISettingsProxy>();
            _navigation   = Services.GetService <INavigationService>();
            _dialog       = Services.GetService <IDialogService>();
            _notification = Services.GetService <INotificationService>();

#if DEBUG
            AppCenter.Start("029ab91d-1e4b-4d4d-9661-5d438dd671a5",
                            typeof(Analytics), typeof(Crashes));
#else
            AppCenter.Start("79d23520-a486-4f63-af81-8d90bf4e1bea", typeof(Analytics));
#endif

            InitializeComponent();
            Suspending         += OnSuspending;
            Resuming           += OnResuming;
            UnhandledException += OnUnhandledException;
        }
Exemplo n.º 3
0
        public PasswordGenerationBoxControlVm(IMediator mediator, ISettingsProxy settings, ICredentialsProxy credentials)
        {
            _mediator    = mediator;
            _settings    = settings;
            _credentials = credentials;

            GeneratePasswordCommand = new RelayCommand(async() => await GeneratePassword());
        }
Exemplo n.º 4
0
        public NewVm(IMediator mediator, ISettingsProxy settings, INavigationService navigation, IFileProxy file, IResourceProxy resource) : base(file)
        {
            _mediator   = mediator;
            _settings   = settings;
            _navigation = navigation;
            _file       = file;
            _resource   = resource;

            CreateDatabaseFileCommand = new RelayCommand(async() => await CreateDatabaseFile());

            MessengerInstance.Register <CredentialsSetMessage>(this, async m => await TryCreateDatabase(m));
        }
Exemplo n.º 5
0
 public SettingsSaveVm(ISettingsProxy settings)
 {
     _settings = settings;
 }
Exemplo n.º 6
0
 public GeneralVm(ISettingsProxy settings)
 {
     _settings = settings;
 }
Exemplo n.º 7
0
 public SettingsNewVm(ISettingsProxy settings)
 {
     _settings = settings;
 }