コード例 #1
0
        protected override void InitializeDependencies()
        {
            base.InitializeDependencies();

            _iconsService      = App.Container.GetInstance <IIconsService>();
            _statisticsManager = App.Container.GetInstance <IStatisticsManager>();
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="translationService"></param>
        /// <param name="databaseRepository"></param>
        /// <param name="passwordService"></param>
        /// <param name="iconsService"></param>
        /// <param name="clipboardService"></param>
        public EntryViewModel(ITranslationService translationService,
                              IDatabaseRepository databaseRepository,
                              IPasswordService passwordService,
                              IIconsService iconsService,
                              IClipboardService clipboardService)
            : base(translationService)
        {
            this.databaseRepository = databaseRepository;
            this.passwordService    = passwordService;
            this.iconsService       = iconsService;
            this.clipboardService   = clipboardService;

            iconsService.IconDownloadedEvent += IconDownloadedEventHandler;

            backupPasswordEntry                = new PasswordEntryModel();
            Categories                         = new ObservableCollection <string>();
            UserControlVisibility              = false;
            DeletionConfimationVisibility      = false;
            PasswordGenerationDialogVisibility = false;

            Messenger.Default.Register <DatabaseUnloadedMessage>(this, DatabaseUnloadedHandler);
            Messenger.Default.Register <EntrySelectedMessage>(this, EntrySelectedHandler);
            Messenger.Default.Register <ShowNewEntryViewMessage>(this, StartEntryCreation);
            Messenger.Default.Register <CategoryAddedMessage>(this, HandleNewCategory);
            Messenger.Default.Register <CategoryDeletedMessage>(this, CategoryDeletedHandler);
            Messenger.Default.Register <CategoryEditedMessage>(this, CategoryEditedHandler);
            Messenger.Default.Register <LanguageChangedMessage>(this, LanguageChangedHandler);
        }
コード例 #3
0
        public DependenciesService(IDataContext dataContext, IIconsService iconsService)
        {
            _dataContext  = dataContext;
            _iconsService = iconsService;

            _dataContext.Loaded  += DataContextLoaded;
            _iconsService.Loaded += IconsLoaded;
        }
コード例 #4
0
        public DefaultCategoriesInitializer(IDataContext dataContext, IIconsService iconsService)
        {
            _dataContext  = dataContext;
            _iconsService = iconsService;

            _dataContext.Loaded  += DataContextLoaded;
            _iconsService.Loaded += IconsLoaded;
        }
コード例 #5
0
        public OptionsViewModel()
        {
            _iconsService = App.Container.GetInstance <IIconsService>();
            _ratesService = App.Container.GetInstance <IRatesService>();
            _dataContext.Categories.Collection.CollectionChanged += CategoriesCollectionChanged;
            _dataContext.Loaded += DataContextUpdated;

            InitializeQuickAccess();
        }
コード例 #6
0
        private void ConfigurateContainer()
        {
            _bootStrapper = new BootStrapper();
            _bootStrapper.Initialize();

            _options      = Container.GetInstance <Options>();
            _dataContext  = Container.GetInstance <IDataContext>();
            _ratesService = Container.GetInstance <IRatesService>();
            _iconsService = Container.GetInstance <IIconsService>();
        }
コード例 #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="databaseRepository"></param>
        /// <param name="iconsService"></param>
        public DatabaseSelectionViewModel(ITranslationService translationService,
                                          IDatabaseRepository databaseRepository,
                                          IIconsService iconsService,
                                          ISettingsService settingsService)
            : base(translationService)
        {
            this.databaseRepository = databaseRepository;
            this.iconsService       = iconsService;
            this.settingsService    = settingsService;

            iconsService.IconsLoadedEvent += IconsLoadedEventHandler;

            Messenger.Default.Register <ShowDatabaseSelectionViewMessage>(this, InitUserControl);
        }
コード例 #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="translationService"></param>
        /// <param name="iconsService"></param>
        /// <param name="clipboardService"></param>
        public EntryListViewModel(ITranslationService translationService,
                                  IIconsService iconsService,
                                  IClipboardService clipboardService)
            : base(translationService)
        {
            this.iconsService     = iconsService;
            this.clipboardService = clipboardService;

            iconsService.IconDownloadedEvent += IconDownloadedEventHandler;

            basePasswordEntries = new List <PasswordEntryModel>();

            Messenger.Default.Register <DatabaseLoadedMessage>(this, DatabaseLoadedHandler);
            Messenger.Default.Register <DatabaseUnloadedMessage>(this, DatabaseUnloadedHandler);
            Messenger.Default.Register <EntryEditedMessage>(this, EntryEditedHandler);
            Messenger.Default.Register <EntryAddedMessage>(this, EntryAddedHandler);
            Messenger.Default.Register <EntryDeletedMessage>(this, EntryDeletedHandler);
            Messenger.Default.Register <CategorySelectedMessage>(this, CategorySelectedHandler);
            Messenger.Default.Register <CategoryDeletedMessage>(this, CategoryDeletedHandler);
            Messenger.Default.Register <CategoryEditedMessage>(this, CategoryEditedHandler);
        }
コード例 #9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="translationService"></param>
        /// <param name="settingsService"></param>
        /// <param name="databaseRepository"></param>
        /// <param name="iconsService"></param>
        /// <param name="encryptionService"></param>
        /// <param name="clipboardService"></param>
        public MainViewModel(ITranslationService translationService,
                             ISettingsService settingsService,
                             IDatabaseRepository databaseRepository,
                             IIconsService iconsService,
                             IEncryptionService encryptionService,
                             IClipboardService clipboardService)
            : base(translationService)
        {
            this.settingsService    = settingsService;
            this.databaseRepository = databaseRepository;
            this.iconsService       = iconsService;
            this.encryptionService  = encryptionService;
            this.clipboardService   = clipboardService;

            MainViewVisibility             = false;
            DatabaseOpeningGroupVisibility = true;
            SettingsVisibility             = false;
            SyncVisibility = false;

            Messenger.Default.Register <DatabaseLoadedMessage>(this, DatabaseLoadedHandler);
            Messenger.Default.Register <ToggleSettingsViewMessage>(this, SettingsViewVisibilityHandler);
            Messenger.Default.Register <ToggleSyncViewMessage>(this, SyncViewVisibilityHandler);
        }
コード例 #10
0
 public UrlToIconBitmapSourceConverter()
 {
     iconsService = ServiceLocator.Current.GetInstance <IIconsService>();
 }
コード例 #11
0
 public IconsController(IIconsService iconsService)
 {
     this.iconsService = iconsService;
 }
コード例 #12
0
 public CategoriesController(ICategoriesService categoriesService,
                             IIconsService iconsService)
 {
     _categoriesService = categoriesService;
     _iconsService      = iconsService;
 }