Ckrule rule editor is used in wpf, ckrulewpf
Currently, ckrule's IDE and business management systems are both developed by winform, And the rule Editor only provides the winform version. Therefore, many of our friends have put forward their comments that the wpf version should be available. The interface settings and Management of wpf are more convenient.
In fact, you can use the ckrule rule editor in wpf. The method is as follows:
1. Introduce the related dll of windowsform integration in the wpf project.Contains two dll types: System. Windows. Forms. dll and WindowsFormsIntegration. dll.
2. Introduce the WindowsFormsHost control.To facilitate control interface deployment, you can add a Windows form panel to the control. <Window x: Class = "RuleEditorWpfApplication1.MainWindow"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns: wfi = "clr-namespace: System. Windows. Forms. Integration; assembly = WindowsFormsIntegration"
Xmlns: wf = "clr-namespace: System. Windows. Forms; assembly = System. Windows. Forms"
Title = "MainWindow" Height = "350" Width = "525" Loaded = "Window_Loaded">
<Grid>
<WindowsFormsHost Height = "350" HorizontalAlignment = "Left" Margin = "486," Name = "windowsFormsHost1" VerticalAlignment = "Top" Width = "">
<Wf: Panel x: Name = "pnlMain" Dock = "Fill" Width = "486" Height = "350"/>
</WindowsFormsHost>
</Grid>
</Window>
3. Load the ckrule rule editor control.Put the rule file in the ckruleAdmin directory and explicitly call it in the program. Public partial class MainWindow: Window {public const string RuleInstName = "HR-payroll-oral formula"; RuleEditorFacade _ editorFacade = new RuleEditorFacade (); public MainWindow () {InitializeComponent ();} private void Window_Loaded (object sender, RoutedEventArgs e) {var _ curPackage = new RuleFacade (). getPkgInst (RuleInstName); if (_ curPackage = null) {MessageBox. show ("failed to load Rule Set"); return;} var _ ctrl = _ editorFacade. getEditor (_ curPackage); _ ctrl. dock = System. windows. forms. dockStyle. fill; pnlMain. controls. add (_ ctrl); var _ propset = new CustUnstructPropDef (); _ propset. codeStyle = CodeStyleDef. ifElseStyle; _ editorFacade. loadData (_ propset );}}
4. Interface demonstrationThe rule editor is displayed on the wpf interface.
SummaryCkrule is written using winform technology. Many friends have made valuable comments on the Interface System. The ckrule technical team also understands the importance of interface optimization, however, at present, more energy is concentrated in the processing and upgrading of internal logic. We have always believed that the processing of internal logic is the top priority of the rule engine. At the same time, we also accept the guidance and criticism from netizens. Currently, we recommend that the technical administrator or implementer maintain the rules. If you want to directly provide the rules to the customer, you can purchase the business management system (BRMS, after all, ckrule focuses on rule processing, while customizing various customer interfaces is not the focus of our work.
Source code downloadHttp://pan.baidu.com/s/1qWofwYS ckrule example-> regular editor example. Zip