The use of the Ckrule rule Editor in WPF

Source: Internet
Author: User

Currently, Ckrule's IDE and business management system are developed by WinForm, and the Rules editor only provides WinForm versions, so many friends have commented on the WPF version. WPF's interface is more convenient to set up and manage.

In fact, you can use the Ckrule rule Editor in WPF, using the following methods: 1, introduce the WindowsForm integrated related DLLs in the WPF project. Contains 2 DLLs, System.Windows.Forms.dll and WindowsFormsIntegration.dll, respectively
2, introducing the WindowsFormsHost controlTo make it easier to control the deployment of the interface, you can add WindowsForm panel to the control. <window x:class= "Ruleeditorwpfapplication1.mainwindow"
Xmlns= "Http://"
xmlns:x= "Http://"
XMLNS:WFI = ";assembly=windowsformsintegration"
XMLNS:WF = ";"
Title= "MainWindow" height= "width=" 525 "loaded=" window_loaded ">
<windowsformshost height= "horizontalalignment=" "left" margin= "5,5,0,0" name= "WindowsFormsHost1" Verticalalignment= "Top" width= "486" >
<wf:panel x:name= "Pnlmain" dock= "Fill" width= "486" height= "a"/>
</Window> 3, loading the Ckrule Rule Editor Control    Place the rule file in the Ckruleadmin directory and call it explicitly in the program.     Public partial class mainwindow:window    {        Public const string Rulei Nstname = "Human-wage calculation-colloquial formula";        Ruleeditorfacade _editorfacade = new Ruleeditorfacade ();          public MainWindow ()         {            Init Ializecomponent ();       }         private void window_loaded (object sender , RoutedEventArgs e)         {            var _curpackage = new Rulefacad E (). Getpkginst (ruleinstname);            if (_curpackage = = null)         &NB Sp   {                MessageBox.Show ("Load Rule package failed");        &NB Sp       return;           }      &NBSP     var _ctrl = _editorfacade.geteditor (_curpackage);            _ctrl. Dock =;            PNLMAIN.CONTROLS.ADD (_ctrl);             var _propset = new Custunstructpropdef ();          &NBS P _propset. Codestyle = codestyledef.ifelsestyle;            _editorfacade.loaddata (_propset);       }   }  4, Interface demoYou can see that the WPF interface displays the rule editor.
OverviewCkrule are written using WinForm technology, many friends of the interface system has put forward valuable advice, Ckrule technical team also know the importance of interface optimization, but now more focus on internal logic processing and upgrading, We have always believed that the internal logic of the processing of the rule engine is the most serious, but also deeply accept the user's pointing criticism. Currently, we recommend that the technical Administrator or implementation personnel maintain the rules, and really want to provide directly to the customer when using, on the purchase of Business Management System (BRMS) system, on some systems to optimize and adjust the interface, after all, ckrule in the focus on rule processing, and customization of the various customer interface, not our work focus. Source code DownloadHttp:// Ckrule Example of the rule editor using the example. zip

The use of the Ckrule rule Editor in WPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.