class BaseControl:UserControl {  ... }  
class AControl:BaseControl{ ... }
class BControl:BaseControl{ ... } 
class CControl:BaseControl{ ... }  

解决方案 »

  1.   


    <local:BaseControl x:Class="WPF1.UserControl1"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:local="clr-namespace:WPF1"
                 mc:Ignorable="d" 
                 d:DesignHeight="300" d:DesignWidth="300">
        <Grid>
                
        </Grid>
    </local:BaseControl>
    按照你的写法,创建新的用户控件的时候,是这样的吗?
      

  2.   

    现在有个问题哦,那些方法是要强制执行的,要定义一个接口才行哦
    既要继承自一个接口,又要继承自UserControl,这个类该怎么写呢?
      

  3.   

    <base:ICompanyLevelControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="ENPOT.Distribution.Management.View.UcCompanyLevel"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
               xmlns:me="clr-namespace:ENPOT.Distribution.Management.Common"                                                                                                       
               xmlns:base="clr-namespace:ENPOT.Distribution.Management.View"namespace ENPOT.Distribution.Management.View
    {
        public partial class UcCompanyLevel : ICompanyLevelControl
        {
    ICompanyLevelControl就是继承了 UserControl