/// <summary> /// Gramps export XML plus media. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="parameter"> /// The parameter. /// </param> public async void PickFile() { BaseCL.LogProgress("Calling folder picker"); try { if (await StoreFileUtility.PickCurrentInputFile().ConfigureAwait(false)) { BaseCL.LogProgress("Tell someone to load the file"); // Remove the old dateTime stamps so the files get reloaded even if they have // been seen before CommonLocalSettings.SetReloadDatabase(); BaseEventAggregator.GetEvent <DataLoadStartEvent>().Publish(false); BaseEventAggregator.GetEvent <PageNavigateEvent>().Publish(nameof(MessageLogPage)); await DataStore.CN.ChangeLoadingMessage("File picked").ConfigureAwait(false); } else { BaseCL.LogProgress("File picker error"); DataStore.CN.NotifyAlert("No input file was selected"); // Allow another pick if required LocalCanHandleDataFolderChosen = true; } } catch (Exception ex) { DataStore.CN.NotifyException("Exception when using File Picker", ex); } }
//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); }
/// <summary> /// Gramps export XML plus media. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="parameter"> /// The parameter. /// </param> public void UseExistingFolder() { LocalCanHandleDataFolderChosen = false; if (DataStore.AD.CurrentDataFolderValid) { BaseCL.LogProgress("Tell someone to load the file"); // Remove the old dateTime stamps so the files get reloaded even if they have been // seen before Preferences.Set(CommonConstants.SettingsGPKGFileLastDateTimeModified, DateTime.MinValue); Preferences.Set(CommonConstants.SettingsGPRAMPSFileLastDateTimeModified, DateTime.MinValue); Preferences.Set(CommonConstants.SettingsXMLFileLastDateTimeModified, DateTime.MinValue); BaseEventAggregator.GetEvent <DataLoadStartEvent>().Publish(false); BaseEventAggregator.GetEvent <PageNavigateEvent>().Publish(nameof(MessageLogPage)); } }
/// <summary> /// Loads the sample data. /// </summary> public void LoadSample() { BaseCL.LogProgress("Load sample data"); CommonRoutines.ListEmbeddedResources(); // Load Resource var assemblyExec = Assembly.GetExecutingAssembly(); var resourceName = "GrampsView.AnythingElse.SampleData.EnglishTudorHouse.gpkg"; DataStore.AD.CurrentInputStream = assemblyExec.GetManifestResourceStream(resourceName); DataStore.AD.CurrentInputStreamPath = "AnythingElse/Sample Data/EnglishTudorHouse.gpkg"; BaseCL.LogProgress("Tell someone to load the file"); // Remove the old dateTime stamps so the files get reloaded even if they have been seen before CommonLocalSettings.SetReloadDatabase(); BaseEventAggregator.GetEvent <DataLoadStartEvent>().Publish(false); BaseEventAggregator.GetEvent <PageNavigateEvent>().Publish(nameof(MessageLogPage)); }
/// <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"); }