我为 Visual Studio 2012 制作了工具窗口扩展。在扩展中,我尝试显示一些简单的图形。我收到奇怪的错误:XamlParserException。该方法或操作未实现。这是我的 Xaml:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
xmlns:local="clr-namespace:Microsoft.NewGraph" x:Class="Microsoft.NewGraph.MyControl"
x:Name="root">
<Grid>
<graphsharp:GraphLayout x:Name="graphLayout" Graph="{Binding ElementName=root,Path=GraphToVisualize}" />
</Grid>
这是代码:
public partial class MyControl : UserControl
{
private IBidirectionalGraph<object, IEdge<object>> _graphToVisualize;
public IBidirectionalGraph<object, IEdge<object>> GraphToVisualize
{
get { return _graphToVisualize; }
}
public MyControl()
{
InitializeComponent();
}
如果我对 WPF 应用程序使用相同的代码,一切正常。什么对 VS 扩展不起作用?