I am posting this to help you avoid the subject and strange side effects with standard and custom Controllers in your applications while writing custom code. I am inspired by a customer who had a strange issue with non-working
validation logic triggered by the the OK Action in a custom dialog window. The funny thing is that it all worked when the same dialog window was invoked via the standard
PopupWindowShowAction instead of writing custom and configuring
ShowViewParameters manually. Fortunately, I knew what the problem is even without looking at the dialog window invocation code, which was really incorrect because of the following line:
DialogController dc = new DialogController();
It appears to be fully correct at first glance, but this is wrong, because by instantiating a Controller class this way a user left it unaware of the Application Model and other important XAF environment, which is responsible for many things like localization, validation, etc. As a result, no validation settings for the OK Action were taken into account...
The fix is also very easy:
DialogController dc = this.Application.CreateController<DialogController>();