我有 SilverLight USercontrol,在打开它的设计部分时,我收到了这个错误
Cannot create an instance of "DialogBase".
at Microsoft.Expression.DesignModel.Core.InstanceBuilderOperations.InstantiateType(Type type, Boolean supportInternal, Boolean supportProtected)
at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateTargetType(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.Platform.Silverlight.InstanceBuilders.DependencyObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.Platform.Silverlight.InstanceBuilders.FrameworkElementInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at MS.Internal.Services.DesignModeValueProviderService.DesignModeValueProviderBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.DesignModel.Core.ViewNodeManager.Instantiate(ViewNode viewNode)
我收到建议,为此,我们必须从 UserControl 声明中删除“抽象”定义
我的 xml 文件是
<cc:DialogBase x:Class="LMS.Client.View.FindLeadDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:cc="clr-namespace:LMS.Client.View;assembly=LMS.Client.Common"
xmlns:interaction="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:commanding="clr-namespace:LMS.Client.Commanding;assembly=LMS.Client.Common"
xmlns:control="clr-namespace:LMS.Client.Controls;assembly=LMS.Client.Common"
xmlns:vc="clr-namespace:LMS.Client.Controls"
xmlns:viewModel="clr-namespace:LMS.Client.Model;assembly=LMS.Client.Model"
KeyDown="DialogBase_KeyDown" FontSize="10"
Title="Find Leads">
.........
</cc:DialogBase>
cs 文件是这样的:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
namespace LMS.Client.View
{
public partial class FindLeadDialog
{
public FindLeadDialog()
{
InitializeComponent();
}
.....
}
}
请指导我从用户控件中删除抽象定义的位置