博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
综合应用WPF/WCF/WF/LINQ之三:采用用代码创建的方式实现CheckListBox的CustomControl
阅读量:6937 次
发布时间:2019-06-27

本文共 1537 字,大约阅读时间需要 5 分钟。

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

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

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

    1 
using System;
    2 
using System.Collections;
    3 
using System.Collections.Generic;
    4 
using System.Linq;
    5 
using System.Text;
    6 
using System.Windows;
    7 
using System.Windows.Controls;
    8 
using System.Windows.Data;
    9 
using System.Windows.Documents;
   10 
using System.Windows.Input;
   11 
using System.Windows.Media;
   12 
using System.Windows.Media.Imaging;
   13 
using System.Windows.Navigation;
   14 
using System.Windows.Shapes;
   15 
using Eallies.OA.UI.Controls.Logical;
   16 
   17 
namespace Eallies.OA.UI.User
   18 {
   19     
public 
partial 
class 
List : 
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
    2    
xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    3    
xmlns
:
x
="http://schemas.microsoft.com/winfx/2006/xaml"
    4    
xmlns
:
logical
="clr-namespace:Eallies.OA.UI.Controls.Logical;assembly=Eallies.OA.UI.Controls.Logical"
    5    
x
:
Class
="Eallies.OA.UI.User.List">
    6 
</
logical
:
PageBase
>
本文转自 Eallies 51CTO博客,原文链接:http://blog.51cto.com/eallies/79057,如需转载请自行联系原作者
你可能感兴趣的文章
MyBatis注解select in参数
查看>>
禁止有道爬虫
查看>>
java核心技术I
查看>>
关于用VS实现开机自启动功能(win7/winXp)
查看>>
重拾Python 笔记五
查看>>
Yii 日志
查看>>
我的友情链接
查看>>
3.2 双向链表
查看>>
MySQL for Mac 安装和基本操作
查看>>
MFC does not support WINVER less than 0x0501.
查看>>
如何用一年时间学完MIT四年的计算机科学课程
查看>>
网络之二
查看>>
Go应用程序使用dockerfile multi-stage的问题
查看>>
吐槽:iOS要获得联系人所属分组好麻烦
查看>>
中文环境下的Weblogic
查看>>
[Android]开源中国源码分析——UI设计XML文件分析
查看>>
Angular CLI 常用命令
查看>>
Nginx的安装和配置
查看>>
mysql 5.6.27 rpm 安装
查看>>
Android Studio 创建项目常见问题
查看>>