Search This Blog

Showing posts with label integration. Show all posts
Showing posts with label integration. Show all posts

Friday, January 20, 2017

How to replace XAF exception handling with Logify

I would like to promote a KB article on the subject, which I published yesterday right after receiving a customer request in response to the recent DevExpress Logify: a New Exception Reporting Tool  blog post.

The XAF article describes three typical ways to integrate Logify into an XAF app. Here I want to note that while the third option with a custom trace listener may look a bit complicated now, it is possible that the Logify team will come up with a built-in trace listener in the future (at least I talked about this with the responsible team and they also said that they thought about such an option). This way you will be able to plug-in this listener in an XAF app using a few lines in the configuration file or in code as per How to: Create and Initialize Trace Listeners (MSDN).


We would greatly appreciate it if you inform us of which XAF integration approach (# 1,2,3 or any other) you eventually implemented in your project and how it all worked for you. Thanks in advance!

Thursday, December 29, 2016

A custom XAF PropertyEditor example based on the WinForms TimeSpanEdit component

As you know, XAF is very flexible and provides many ways of integrating custom controls for various scenarios; e.g., where something is not covered by the default controls pack: Concepts > UI Construction > Using a Custom Control that is not Integrated by Default

As far as our framework development flow is concerned, it is absolutely natural to perform this sort of customizations, and this extensibility was baked in from the very beginning for XAF users. For instance, there is a built-in WinForms TimeSpanPropertyEditor class for representing and editing System.TimeSpan type properties in the standard delivery:

        public TimeSpan TimeSpanProperty {
            get { return GetPropertyValue<TimeSpan>("TimeSpanProperty"); }
            set { SetPropertyValue<TimeSpan>("TimeSpanProperty", value); }
        }

Technically, our TimeSpanPropertyEditor just wraps a TextEdit descendant from the XtraEditors Library and provides a custom mask for it. One may want to use another visual control for the same task (e.g., the TimeSpanEdit control from the same XtraEdititors library) and that is quite easy to implement in XAF. You can implement a custom PropertyEditor as per  Concepts > UI Construction > View Items > Implement Custom Property Editors


Monday, December 19, 2016

How to view and edit only time values without the date part

I would like to promote a new KB article on integrating the WinForms TimeEdit and ASP.NET WebForms ASPxTimeEdit components in XAF:



My team and I would greatly appreciate it if you leave comments on whether you experienced similar tasks in the past and how you were solving them, or if you remember any difficulties with these solutions/maintenance.




Thursday, February 26, 2015

Check out an example demonstrating a possible way of integrating Snap reports in an XAF WinForms application

The example integration shows how to store DevExpress Snap reports layout in business objects and show a list of these objects, as this is done in the built-in Reports module. The main tool for working with these reports is a custom Snap designer form. Underlying business objects can be configured using custom buttons from this form. It is also possible to show a read-only preview form using corresponding actions.

You can download the actual test project and research the example implementation from here: 

Wednesday, January 21, 2015

Simplifying integration of custom controls bound to data from XAF application database - YOUR FEEDBACK IS NEEDED

Scenario


We are researching options to make it easier for our users to achieve the subject in the next version. One of the popular scenarios we were aware of from our users was integration of custom controls, often created in Visual Studio using the standard WinForms or ASP.NET WebForms approaches, and primarily designed for presenting data from the XAF application database in some very custom manner so that built-in XAF Property Editors  or List Editors were not good for this. For instance, you might want to show a list of records in a fancy grid with cards, image gallery or other controls or modes not integrated by default.




Current solutions and problems

XAF is very extensible framework and offers many ways of integrating custom or third party controls. We noticed that while doing so, feeding these custom controls with data from the application database was often a challenge for our users. This binding is done automatically for built-in forms and data editors, but requires writing some code that will read data via the IObjectSpace.GetObjects<T> method (to respect data security filters) and also listen to the IObjectSpace.Reloaded and other events to handle data updates. Finally, designing a data bound user control in Visual Studio often implies a direct connection to the database or using specialized data sources (e.g., to generate a list of grid columns or pivot fields), which do this for you. The latter forces you to think about obtaining an application connection string at design time, while this dynamic part is changed later in the most cases. Add to this different approaches for Entity Framework and XPO and you will get the whole picture.

New solutions (not yet built-in!)

Briefly, we decided to simplify this scenario. Here are two videos that shows one possible option:

ASP.NET:  http://www.screencast.com/t/OHhcHD9vy

WinForms: http://www.screencast.com/t/8M8K4eskkYO9

How it works?


In short, the proposed flow is as follows: