This project is read-only.


Configuration is the heart of the framework code and provides the way to:

  • control of application executing flow
  • create loosely-coupled classes
  • support plugin architecture
  • simplify unit testing

Let`s have a look at application.config:

<?xml version="1.0" encoding="utf-8" ?>
    <config include="fwk.system.config" location="file" optional="false" />
    <config include="securebox.views.config" location="file" optional="false" />
    <config include="" location="file" optional="false" />

As you can see, the configuration is stored as xml file in which there are defined other configuration files (from version 0.5.1). This approach helps to group the configuration for different subsystem in different files. For example, fwk.system.config file contains information about configuration of framework:

<?xml version="1.0" encoding="utf-8" ?>
<settings environment="release">
    <container type="PhoneCore.Framework.Container,PhoneCore.Framework">
      <types />
    <!-- bootstrapping -->
        <bootstrapper name="Core" type="PhoneCore.Framework.Bootstrap.CoreBootstrapperPlugin, PhoneCore.Framework">
            <navigation type="PhoneCore.Framework.Navigation.NavigationService, PhoneCore.Framework" />
            <fileSystem type="PhoneCore.Framework.Storage.IsolatedStorageFileService, PhoneCore.Framework" />
            <settings type="PhoneCore.Framework.Storage.IsolatedStorageSettingService, PhoneCore.Framework" />
        <bootstrapper name="Init" type="SecureBox.UI.Infrastructure.Plugins.InitPlugin, SecureBox.UI" />
        <bootstrapper name="DataContext" type="SecureBox.UI.Infrastructure.Plugins.DataContextPlugin, SecureBox.UI"  />
        <bootstrapper name="PassGen" type="SecureBox.UI.Infrastructure.Plugins.PassGenPlugin, SecureBox.UI"  />
      <service />
      <!-- trace subsystem-->
        <trace name="default" type="PhoneCore.Framework.Diagnostic.Tracing.DefaultTrace, PhoneCore.Framework">
          <storage connectionString="Data Source=isostore:/tracedb.sdf">
                <type name="Info" />
                <type name="Warn" />
                <type name="Error" />
                <type name="Fatal" />
          <controller type="PhoneCore.Framework.Diagnostic.Tracing.DefaultTraceController, PhoneCore.Framework"
                      template="Resources/Templates/DefaultTraceReport.txt" />

The securebox.views.config file contains the settings of views and view models which are specific for SecureBox application:

<?xml version="1.0" encoding="utf-8" ?>
<settings environment="release">
    <!-- page mapping -->
      <resolver type="SecureBox.UI.Infrastructure.PageResolver, SecureBox.UI" />
        <page name="Startup">
          <uri type="relative" address="/ViewPage/StartupViewPage.xaml" />
          <viewModel type="SecureBox.UI.ViewModel.StartupViewPageModel, SecureBox.UI" />
        <page name="Library">
          <uri type="relative" address="/ViewPage/LibraryViewPage.xaml" />
          <viewModel type="SecureBox.UI.ViewModel.LibraryViewPageModel, SecureBox.UI" />
      <!-- cut -->

Let's look at the main settings:

  • system/container – configures the settings of dependency injection container, attribute name specify the type of using container
  • system/bootstrapping - defines the tasks for bootstrapper service which should be run only once, e.g. :
    • register types in container
    • initialize page mapping
  • system/diagnostic/tracing - defines the tracing subsystem
  • views/pageMapping – defines mapping between pages and its view models

User can define custom settings/configs and easily access them into the code using ConfigSettings members described in details here.


When configuration is starting to merge, it reads environment attribute from settings node:

<settings environment="release">
  <system />

If environmen is defined, the configs will be filter by this value. It will be useful for changing of functionality depending of "environment", e.g.:

  • testing
  • development
  • trial
  • full

Last edited Feb 11, 2012 at 9:44 PM by Ilya_Builuk, version 6


No comments yet.