您好我收到了以下错误:
无法创建程序集“ProductListing,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null”中定义的“ProductListingUserControl”实例。调用的目标抛出了异常。标记文件'ProductListing; component / views / productlistingcshostedcontrol.xaml'中的对象'System.Windows.Controls.Grid'出错'第22行位置10.
我有一个用户控件,我在另一个类中使用。在另一个类中,我定义了一个事件ProductSelectionChangedEvent,当我创建User控件的实例时,它会给我上面的错误。
我正在为我的用户控件创建以下事件:
Window w = Window.GetWindow(productServiceFunction);
w.LocationChanged += new EventHandler(ProductListingUserControl_LocationChanged);
this.SizeChanged += new SizeChangedEventHandler(ProductListingUserControl_SizeChanged);