Ticket T151653
Visible to All Users

Xaf Model validation rules in non-XAF application

created 10 years ago

I am trying to use the validation rules in a non-XAF application.

How can I load the validation rules that are defined in the Model?

I have looked at https://documentation.devexpress.com/#xaf/CustomDocument3294 but it does not explain how to load rules from the Model.

I have tried creating my own XafApplication descendant and adding all my modules to it. I then use Validator.RuleSet to validate but it only shows the rules that are defined in the attributes not the model.

Answers approved by DevExpress Support

created 10 years ago (modified 10 years ago)

Hello Tobie,

This is a specific and non-standard task, so you will not find guidelines for this in our public documentation.
Please review the source code of the ValidationModule.InitializeRuleSet and related methods to learn more on how to accomplish this task. In our code this method is triggered by the RuleSetInitializationController WindowController class. Since there may be no Frames and Controllers in your non-XAF app, you will have to trigger this module's method yourself. Of course, it assumes that all the required infrastructure is ready to use.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.