我有课程customer
and product
。他们的相似之处在于班级Base Record
。然而,其中的类型Base Record
总是取决于它是否是customer
or product
。因此,我有Base Record
一般创建的。
立刻customer
or product
继承自Base Record
,我在 WPF 项目中收到 XMAL 错误。不幸的是,我不知道为什么会这样,为什么我写在这里;)
基本记录头:
public abstract class BaseRecord<T> : Notify where T : class, new()
客户标题:
public class Customer : BaseRecord<Data_Layer.Customer>
XAML 错误:
Unknown build error, 'Cannot resolve dependency to assembly 'Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on
demand through the ReflectionOnlyAssemblyResolve event.'
AND:
The tag 'CustomerAddWindow' does not exist in XML namespace 'clr-namespace:Business_Layer.Windows.Customer;assembly=Business_Layer'
如果我上课BaseRecord
不是通用的,一切都按我想要的方式工作。
在 XAML 中,我实例化
<local:Customer x:Key="CustomerViewModel "/>
新年快乐。