在 WPF 浏览器应用程序中使用我制作的 WPF 用户用户控件库时,我遇到了这个问题。
我将其添加到页面如下,并将对我的用户控件的引用添加到项目中
<Page x:Class="Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:tools="clr-namespace:Visualisation;assembly=Visualisation"
mc:Ignorable="d"
d:DesignHeight="600"
d:DesignWidth="1100"
Title="Page1">
<Grid Name="main">
<tools:uc3dview Name="_View"></tools:uc3dview>
</Grid>
</Page>
我收到以下错误。
System.Reflection.TargetInvocationException was unhandled
Message: Exception has been thrown by the target of an invocation.
如果我在 WPF 应用程序中使用这个精确的用户控件,我没有问题。
我是否缺少一些构造函数符号,所以我的用户控件库可以在 WPF 应用程序中工作,更重要的是在 WPF 浏览器应用程序中工作。如果这很重要,我正在使用 Visual Studio 2012。
提前致谢。