Application logging configuration

The following steps will guide you through the configuration process of your application to enable default logging support.

First of all, open the KeepItSoft.Fwk.Utility.ttinclude file which is attached as a solution item. In the constructor of the ProjectConfigurator class, set the value of the UserLogger property to true. This property is used by some of the T4 generators to provide a default logging behavior when a critical exception is raised in the business logic layer. Save the file and run the T4 transform tool to generate this behavior.

All you have to do now is check your configuration files so that all binding configurations correctly target your deployed log service. The Service.ConsoleHost and UI.WPF.Views projects already define client bindings for both the ILogService and the IApplicationManagerService contracts. Update those to match the service you deployed. Be aware that if you deployed the LogManager template, you shall also adapt the namespace of the endpoint’s contract to target LogManager rather than ApplicationManager.

As mentioned earlier, the logging system’s automation process is based on the application id. So before going any further, be sure that your configuration files declare an application setting called ApplicationId whose value corresponds to the id of your application as saved in Log Manager/Application Manager.


Paging in collection views

Whenever a collection view shall hold too many items, you can enable paging in order to reduce loading time and network consumption. For this purpose, please follow the following steps:

  • In the constructor of the collection view, before the call to InitializeComponent, set the IsPagingEnabled property to true.
  • Add a DataPager control (KeepItSoft.Fwk.WPF.Controls) to the collection view and bind its PagerContext property to the Pager property of the collection view (Figure 1).

Figure 1

In order to make this feature work, the Count delegate is required so don’t forget to pass it when you call the Initialize method of the base class.

Please be aware that the above steps only allow you to enable paging with sort and filter expressions that are declared by code. By default the datagrid only applies filters on data that it holds in its context. I’ll explain in another post how to allow dynamic sort and filter expressions with paging.