本文共 1537 字,大约阅读时间需要 5 分钟。
以我们的Eallies OA系统为例,实现PageBase的方法如下: 1、在Eallies.OA.UI.Controls.Logical项目中添加一个纯的Class,并让其继承于System.Windows.Controls.Page类。 2 using System.Collections.Generic;
5 using System.Windows.Controls;
7 namespace Eallies.OA.UI.Controls.Logical
9 public class PageBase :
Page 2、在Eallies.OA.UI项目中更改Page的CS代码,让其继承于Eallies.OA.UI.Controls.Logical.PageBase类。 2 using System.Collections;
3 using System.Collections.Generic;
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;
17 namespace Eallies.OA.UI.User
19 public partial class List :
PageBase 3、在Eallies.OA.UI项目中更改Page的XAML代码,增加引用xmlns:logical="clr-namespace:Eallies.OA.UI.Controls.Logical;assembly=Eallies.OA.UI.Controls.Logical",然后将根节点改成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,如需转载请自行联系原作者