/// <summary>
        /// Initializes a new instance of the <see cref="NeedDatabaseReloadViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// Injected common loggeing.
        /// </param>
        /// <param name="iocEventAggregator">
        /// Injected event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// </param>
        public NeedDatabaseReloadViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle = "Database reload needed";

            BaseTitleIcon = CommonConstants.IconSettings;
        }
        public SettingsViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle     = "Settings";
            BaseTitleIcon = CommonConstants.IconSettings;

            switch (CommonLocalSettings.ApplicationTheme)
            {
            case OSAppTheme.Light:
            {
                ThemeButtonLightChecked = true;
                break;
            }

            case OSAppTheme.Dark:
            {
                ThemeButtonDarkChecked = true;
                break;
            }

            default:
            {
                ThemeButtonSystemChecked = true;
                break;
            }
            }
        }
示例#3
0
        //private double mX = 0f;

        //private double mY = 0f;

        /// <summary>
        /// Initializes a new instance of the <see cref="MediaDetailViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// The navigation service.
        /// </param>
        public MediaDetailViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseCL.LogProgress("MediaDetailViewModel created");

            OpenImageCommand = new DelegateCommand(OpenImage, CanOpenImage);
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StorePostLoad"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The ioc common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The ioc event aggregator.
        /// </param>
        public StorePostLoad(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator)
        {
            _EventAggregator = iocEventAggregator;
            _CommonLogging   = iocCommonLogging;

            _EventAggregator.GetEvent <DataLoadXMLEvent>().Subscribe(LoadXMLUIItems, ThreadOption.UIThread);
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PersonDetailViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The common logging service.
        /// </param>
        public PersonDetailViewModel(ICommonLogging iocCommonLogging, IPlatformSpecific iocPlatformSpecific)
            : base(iocCommonLogging)
        {
            BaseTitle     = "Person Detail";
            BaseTitleIcon = CommonConstants.IconPeople;

            _PlatformSpecific = iocPlatformSpecific;
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HubViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The ioc common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The ioc event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// </param>
        public HubViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle     = "Hub";
            BaseTitleIcon = CommonConstants.IconHub;

            BaseEventAggregator.GetEvent <DataLoadCompleteEvent>().Subscribe(CheckHeroImageLoad, ThreadOption.BackgroundThread);
        }
示例#7
0
        public SettingsViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle     = "Settings";
            BaseTitleIcon = CommonConstants.IconSettings;

            TestCommand = new DelegateCommand(TestButtonHandler).ObservesCanExecute(() => CanHandleTestButton);
        }
示例#8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FirstRunViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// Common logger
        /// </param>
        /// <param name="iocEventAggregator">
        /// The ioc event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// </param>
        public FirstRunViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            LoadDataCommand = new DelegateCommand(FirstRunLoadAFileButton);

            BaseTitle = "First Run";

            BaseTitleIcon = CommonConstants.IconSettings;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SetupStorageViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// The navigation service.
        /// </param>
        public WhatsNewViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            LoadDataCommand = new DelegateCommand(LoadDataAction);

            BaseTitle = "What's new";

            BaseTitleIcon = CommonConstants.IconSettings;
        }
示例#10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// Common Logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// Event Aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// NavigationService
        /// </param>
        public SearchPageViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle = "Search Page";

            BaseTitleIcon = CommonConstants.IconSearch;

            SearchButtonCommand = new Command <string>(SearchProcessQuery);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FileInputHandlerViewModel"/> class.
        /// </summary>
        /// <param name="iocDataRepositoryManager">
        /// The ioc data repository manager.
        /// </param>
        /// <param name="iocCommonLogging">
        /// The common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The event aggregator.
        /// </param>
        public FileInputHandlerViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle = "File Input Handler";

            BaseTitleIcon = CommonConstants.IconSettings;

            PickFileCommand = new DelegateCommand(PickFile).ObservesCanExecute(() => LocalCanHandleDataFolderChosen);

            UseExistingFolderCommand = new DelegateCommand(UseExistingFolder).ObservesCanExecute(() => LocalCanHandleUseExistingFolder);
        }
示例#12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommonNotifications"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// Common Logging routines
        /// </param>
        /// <param name="iocEventAggregator">
        /// The event aggregator.
        /// </param>
        public CommonNotifications(ICommonLogging iocCommonLogging,
                                   IEventAggregator iocEventAggregator, IDataLog iocDataLog)
        {
            if (iocEventAggregator is null)
            {
                throw new ArgumentNullException(nameof(iocEventAggregator));
            }

            _iocEventAggregator = iocEventAggregator;

            _iocCommonLogging = iocCommonLogging;

            _DataLog = iocDataLog;
        }
示例#13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommonNotifications"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// Common Logging routines
        /// </param>
        /// <param name="iocEventAggregator">
        /// The event aggregator.
        /// </param>
        public CommonNotifications(ICommonLogging iocCommonLogging,
                                   IEventAggregator iocEventAggregator)
        {
            if (iocEventAggregator is null)
            {
                throw new ArgumentNullException(nameof(iocEventAggregator));
            }

            _iocEventAggregator = iocEventAggregator;

            _iocCommonLogging = iocCommonLogging;

            //_EventAggregator.GetEvent<GVNotificationLogAdd>().Subscribe(DataLoadLogAdd, ThreadOption.UIThread);
        }
示例#14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataRepositoryManager"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The ioc common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The ioc event aggregator.
        /// </param>
        /// <param name="iocExternalStorage">
        /// The ioc external storage.
        /// </param>
        /// <param name="iocGrampsStorePostLoad">
        /// The ioc gramps store post load.
        /// </param>
        /// <param name="iocGrampsStoreSerial">
        /// The ioc gramps store serial.
        /// </param>
        /// <param name="iocStoreFile">
        /// The ioc store file.
        /// </param>
        public DataRepositoryManager(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, IGrampsStoreXML iocExternalStorage, IStorePostLoad iocGrampsStorePostLoad, IGrampsStoreSerial iocGrampsStoreSerial, IStoreFile iocStoreFile)
        {
            _CL = iocCommonLogging ?? throw new ArgumentNullException(nameof(iocCommonLogging));
            localExternalStorage = iocExternalStorage ?? throw new ArgumentNullException(nameof(iocExternalStorage));
            localPostLoad        = iocGrampsStorePostLoad;
            localStoreSerial     = iocGrampsStoreSerial;
            localStoreFile       = iocStoreFile;
            _EventAggregator     = iocEventAggregator;

            // Event Handlers
            //_EventAggregator.GetEvent<AppStartLoadDataEvent>().Subscribe(StartDataLoad, ThreadOption.BackgroundThread);
            _EventAggregator.GetEvent <DataLoadStartEvent>().Subscribe(StartDataLoad, ThreadOption.BackgroundThread);
            _EventAggregator.GetEvent <DataSaveSerialEvent>().Subscribe(SerializeRepositoriesAsync, ThreadOption.BackgroundThread);
            _EventAggregator.GetEvent <DataLoadCompleteEvent>().Subscribe(DataLoadedSetTrue, ThreadOption.BackgroundThread);
        }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NoteDetailViewModel"/> class. Common logging.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// Common logging.
 /// </param>
 /// <param name="iocEventAggregator">
 /// Common Event Aggregator.
 /// </param>
 /// <param name="iocNavigationService">
 /// </param>
 public NoteDetailViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
     BaseTitleIcon = CommonConstants.IconNotes;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PeopleGraphViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The ioc common logging.
 /// </param>
 /// <param name="iocEventAggregator">
 /// The ioc event aggregator.
 /// </param>
 public PeopleGraphViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
     BaseTitle     = "People Graph";
     BaseTitleIcon = CommonConstants.IconPeopleGraph;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EventDetailViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonModelGridBuilder">
 /// The ioc common model grid builder.
 /// </param>
 /// <param name="iocEventAggregator">
 /// The event aggregator.
 /// </param>
 /// <param name="iocCommonLogging">
 /// Common Logging interface.
 /// </param>
 public EventDetailViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
 }
示例#18
0
 public ViewModelBase(ICommonLogging iocCommonLogging)
 {
     BaseCL = iocCommonLogging;
 }
示例#19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GrampsStoreXML"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The gramps view common logging.
        /// </param>
        /// <param name="iocGrampsStorePostLoad">
        /// The ioc gramps store post load.
        /// </param>
        public GrampsStoreXML(ICommonLogging iocCommonLogging)
        {
            localGrampsCommonLogging = iocCommonLogging;

            ns = CommonConstants.GrampsXMLNameSpace;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GrampsStoreSerial"/> class.
 /// </summary>
 /// <param name="iocGVProgress">
 /// The ioc gv progress.
 /// </param>
 /// <param name="iocGVLogging">
 /// The ioc gv logging.
 /// </param>
 public GrampsStoreSerial(ICommonLogging iocGVLogging)
 {
     // save injected references for later
     localGVLogging = iocGVLogging;
 }
示例#21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseViewModel"/> class. Initializes the
 /// specified ioc common logging.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The ioc common logging.
 /// </param>
 /// <param name="iocEventAggregator">
 /// The ioc event aggregator.
 /// </param>
 public ViewModelBase(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
 {
     BaseCL = iocCommonLogging;
     BaseEventAggregator   = iocEventAggregator;
     BaseNavigationService = iocNavigationService;
 }
示例#22
0
 public CommonLogPrism(ICommonLogging iocCommonLogging)
 {
     Logger = iocCommonLogging;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AddressDetailViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The common logging service.
 /// </param>
 public AddressDetailViewModel(ICommonLogging iocCommonLogging)
     : base(iocCommonLogging)
 {
     BaseTitle     = "Address Detail";
     BaseTitleIcon = CommonConstants.IconAddress;
 }
示例#24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaDataView"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The ioc common logging.
 /// </param>
 /// <param name="iocCommonProgress">
 /// The ioc common progress.
 /// </param>
 public MediaDataView(ICommonLogging iocCommonLogging)
 {
     localCL = iocCommonLogging;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EventListViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The common logging.
 /// </param>
 /// <param name="iocEventAggregator">
 /// The event aggregator.
 /// </param>
 /// <param name="iocNavigationService">
 /// Prism Navigation Service.
 /// </param>
 public PersonBirthdayViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
     BaseTitle     = "Person Birthday List";
     BaseTitleIcon = CommonConstants.IconPeopleBirthday;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FamilyListViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The common logging.
 /// </param>
 /// <param name="iocEventAggregator">
 /// The event aggregator.
 /// </param>
 /// <param name="iocNavigationService">
 /// Injected Navigation Service.
 /// </param>
 public FamilyListViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
     BaseTitle     = "Family List";
     BaseTitleIcon = CommonConstants.IconFamilies;
 }
示例#27
0
        public MainPageViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService, FirstRunDisplayService iocFirstRunDisplayService, WhatsNewDisplayService iocWhatsNewDisplayService, DatabaseReloadDisplayService iocDatabaseReloadDisplayService, IDialogService dialogService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            localWhatsNewDisplayService = iocWhatsNewDisplayService;

            localFirstRunDisplayService = iocFirstRunDisplayService;

            localDatabaseReloadDisplayService = iocDatabaseReloadDisplayService;

            _dialogService = dialogService;

            BaseEventAggregator.GetEvent <AppStartFirstRunEvent>().Subscribe(ServiceFirstRun, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <AppStartLoadDataEvent>().Subscribe(ServiceLoadData, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <AppStartReloadDatabaseEvent>().Subscribe(ServiceReloadDatabase, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <AppStartWhatsNewEvent>().Subscribe(ServiceWhatsNew, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <DataLoadCompleteEvent>().Subscribe(LoadHubPage, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <DialogBoxEvent>().Subscribe(ActionDialog, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <PageNavigateEvent>().Subscribe(OnNavigateCommandExecuted, ThreadOption.UIThread);

            BaseEventAggregator.GetEvent <PageNavigateParmsEvent>().Subscribe(OnNavigateParmsCommandExecuted, ThreadOption.UIThread);

            // Build the Menu
            NavigateCommand = new DelegateCommand <string>(OnNavigateCommandExecuted);

            MainMenuItems = new List <MainMenuItem>()

            {
                new MainMenuItem()
                {
                    Title = "Hub", Icon = CommonConstants.IconHub, TargetType = nameof(HubPage)
                },

                new MainMenuItem()
                {
                    Title = "Bookmarks", Icon = CommonConstants.IconBookMark, TargetType = nameof(BookMarkListPage)
                },

                new MainMenuItem()
                {
                    Title = "Citations", Icon = CommonConstants.IconCitation, TargetType = nameof(CitationListPage)
                },

                new MainMenuItem()
                {
                    Title = "Events", Icon = CommonConstants.IconEvents, TargetType = nameof(EventListPage)
                },

                new MainMenuItem()
                {
                    Title = "Families", Icon = CommonConstants.IconFamilies, TargetType = nameof(FamilyListPage)
                },

                new MainMenuItem()
                {
                    Title = "Media", Icon = CommonConstants.IconMedia, TargetType = nameof(MediaListPage)
                },

                new MainMenuItem()
                {
                    Title = "Notes", Icon = CommonConstants.IconNotes, TargetType = nameof(NoteListPage)
                },

                new MainMenuItem()
                {
                    Title = "People", Icon = CommonConstants.IconPeople, TargetType = nameof(PersonListPage)
                },

                new MainMenuItem()
                {
                    Title = "Places", Icon = CommonConstants.IconPlace, TargetType = nameof(PlaceListPage)
                },

                new MainMenuItem()
                {
                    Title = "Repositories", Icon = CommonConstants.IconRepository, TargetType = nameof(RepositoryListPage)
                },

                new MainMenuItem()
                {
                    Title = "Sources", Icon = CommonConstants.IconSource, TargetType = nameof(SourceListPage)
                },

                new MainMenuItem()
                {
                    Title = "Tags", Icon = CommonConstants.IconTag, TargetType = nameof(TagListPage)
                },

                //<!--
                //    new NavigationViewItemSeparator
                //    {
                //    },
                //-->

                new MainMenuItem()
                {
                    Title = "PeopleGraph", Icon = CommonConstants.IconPeopleGraph, TargetType = nameof(PeopleGraphPage)
                },

                //<!--
                //    new NavigationViewItemSeparator
                //    {
                //    },
                //-->

                new MainMenuItem()
                {
                    Title = "Search", Icon = CommonConstants.IconSearch, TargetType = nameof(SearchPage)
                },

                new MainMenuItem()
                {
                    Title = "Choose data file", Icon = CommonConstants.IconChooseDataFile, TargetType = nameof(FileInputHandlerPage)
                },

                new MainMenuItem()
                {
                    Title = "Settings", Icon = CommonConstants.IconSettings, TargetType = nameof(SettingsPage)
                },

                new MainMenuItem()
                {
                    Title = "About", Icon = CommonConstants.IconAbout, TargetType = nameof(AboutPage)
                },
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AddressDetailViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The common logging service.
 /// </param>
 public PersonNameDetailViewModel(ICommonLogging iocCommonLogging)
     : base(iocCommonLogging)
 {
     BaseTitle     = "Name Detail";
     BaseTitleIcon = CommonConstants.IconPersonName;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RepositoryListViewModel"/> class.
 /// </summary>
 /// <param name="iocCommonLogging">
 /// The Common Logger
 /// </param>
 /// <param name="iocEventAggregator">
 /// The ioc event aggregator.
 /// </param>
 /// <param name="iocNavigationService">
 /// The ioc navigation service.
 /// </param>
 public RepositoryListViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
     : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
 {
     BaseTitle     = "Repository List";
     BaseTitleIcon = CommonConstants.IconRepository;
 }
示例#30
0
        //private IHLinkMediaModel _MediaCard = new HLinkMediaModel();

        /// <summary>
        /// Initializes a new instance of the <see cref="HubViewModel"/> class.
        /// </summary>
        /// <param name="iocCommonLogging">
        /// The ioc common logging.
        /// </param>
        /// <param name="iocEventAggregator">
        /// The ioc event aggregator.
        /// </param>
        /// <param name="iocNavigationService">
        /// </param>
        public HubViewModel(ICommonLogging iocCommonLogging, IEventAggregator iocEventAggregator, INavigationService iocNavigationService)
            : base(iocCommonLogging, iocEventAggregator, iocNavigationService)
        {
            BaseTitle     = "Hub";
            BaseTitleIcon = CommonConstants.IconHub;
        }