Example #1
0
        private void AddConfiguration(string[] args)
        {
//{[{
            // TODO: Register arguments you want to use on App initialization
            var activationArgs = new Dictionary <string, string>
            {
                { ToastNotificationActivationHandler.ActivationArguments, string.Empty }
            };
//}]}

            var appLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

            IConfiguration configuration = new ConfigurationBuilder()
                                           .SetBasePath(appLocation)
                                           .AddCommandLine(args)
//{[{
                                           .AddInMemoryCollection(activationArgs)
//}]}
                                           .AddJsonFile("appsettings.json")
                                           .Build();

            Locator.AddConfiguration(configuration);
        }