1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 综合应用WPF/WCF/WF/LINQ之三:采用用代码创建的方式实现CheckListBox的CustomControl

综合应用WPF/WCF/WF/LINQ之三:采用用代码创建的方式实现CheckListBox的CustomControl

时间:2024-04-08 05:38:36

相关推荐

综合应用WPF/WCF/WF/LINQ之三:采用用代码创建的方式实现CheckListBox的CustomControl

以我们的Eallies OA系统为例,实现PageBase的方法如下:

1、在Eallies.OA.UI.Controls.Logical项目中添加一个纯的Class,并让其继承于System.Windows.Controls.Page类。

1usingSystem; 2usingSystem.Collections.Generic; 3usingSystem.Linq; 4usingSystem.Text; 5usingSystem.Windows.Controls; 6 7namespaceEallies.OA.UI.Controls.Logical 8{ 9publicclassPageBase:Page 10 { 11 } 12} 2、在Eallies.OA.UI项目中更改Page的CS代码,让其继承于Eallies.OA.UI.Controls.Logical.PageBase类。

1usingSystem; 2usingSystem.Collections; 3usingSystem.Collections.Generic; 4usingSystem.Linq; 5usingSystem.Text; 6usingSystem.Windows; 7usingSystem.Windows.Controls; 8usingSystem.Windows.Data; 9usingSystem.Windows.Documents; 10usingSystem.Windows.Input; 11usingSystem.Windows.Media; 12usingSystem.Windows.Media.Imaging; 13usingSystem.Windows.Navigation; 14usingSystem.Windows.Shapes; 15usingEallies.OA.UI.Controls.Logical; 16 17namespaceEallies.OA.UI.User 18{ 19publicpartialclassList:PageBase 20 { 21 } 22} 3、在Eallies.OA.UI项目中更改Page的XAML代码,增加引用xmlns:logical="clr-namespace:Eallies.OA.UI.Controls.Logical;assembly=Eallies.OA.UI.Controls.Logical",然后将根节点改成logical:PageBase。

1<logical:PageBase 2xmlns="/winfx//xaml/presentation" 3xmlns:x="/winfx//xaml" 4xmlns:logical="clr-namespace:Eallies.OA.UI.Controls.Logical;assembly=Eallies.OA.UI.Controls.Logical" 5x:Class="Eallies.OA.UI.User.List"> 6</logical:PageBase>

本文转自 Eallies 51CTO博客,原文链接:/eallies/79057,如需转载请自行联系原作者

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。