Пример #1
0
        /// <summary>
        /// Configures our application ready for use
        /// </summary>
        private async Task ApplicationSetupAsync()
        {
            // Set the default working directory
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? Directory.GetCurrentDirectory());

            // Setup the Dna Framework
            Framework.Construct<DefaultFrameworkConstruction>()
                .AddFileLogger()
                .AddClientDataStore()
                .AddClientServices()
                .AddApplicationViewModels()
                .Build();

            await DI.SettingsManager.Initiate();

            FileAssociations.EnsureAssociationsSet();

            // Load settings
            DI.UIManager.UpdateDarkMode(DI.SettingsManager.IsDarkMode());

            DI.UIManager.UpdateFontSize(DI.SettingsManager.GetFontSize());

            // Ensure the client data store 
            await ClientDataStore.EnsureDataStoreAsync();

        }
Пример #2
0
        /// <summary>
        /// Injects the Fasetto Word client application services needed
        /// for the Fasetto Word application
        /// </summary>
        /// <param name="construction"></param>
        /// <returns></returns>
        public static FrameworkConstruction EnsureFileAssosiation(this FrameworkConstruction construction)
        {
#if DEBUG
#else
            FileAssociations.EnsureAssociationsSet();
#endif

            FileAssociations.EnsureAssociationsSet();


            // Return the construction for chaining
            return(construction);
        }