2011-12-20 108 views

回答

0

试试这个创建你的基类说BaseClassView,并从窗口类继承,然后继承你的“WPF窗口

<view:BaseClassView x:Class="MyProject.Views.AddressView" <!- here AddressView inhetrits the BaseClassView --> 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:view="clr-namespace:namespace of BaseClassView "> 

</view:BaseClassView> 

public partial class AddressView /*Do not inherit this class with Window rather inherit BaseClassView (base class with Window class)*/ 
{ 

} 

希望这将有助于

+0

的xmlns =” http://schemas.microsoft。 com/winfx/2006/xaml/presentation“xmlns:x =”http://schemas.microsoft.com/winfx/2006/xaml“xmlns:view =”clr-namespace:BaseClassView的命名空间“> – Harish 2011-12-20 12:15:21

+0

Harish 2011-12-20 12:16:59