2011-12-20 160 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