简体   繁体   English

使用第三方控件

[英]Using third party controls

I am pretty new to WPF Developing and i am trying work with the GraphSharp lib within my project but I cant access the GraphSharp.Controls dll classes. 我是WPF开发人员的新手,正在尝试在项目中使用GraphSharp库,但无法访问GraphSharp.Controls dll类。

i declared this row in my mainwindows.xaml file 我在mainwindows.xaml文件中声明了这一行

xmlns:gsc = "clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"

and when I try to write 当我尝试写

<gsc:GraphLayout/>

Note-GraphLayout is a class that represents a graph in xaml I tried to look on how to declare namespace in xaml and other resources but couldn't find a good answer for my problem... Note-GraphLayout是一个表示xaml中的图形的类,我试图研究如何在xaml和其他资源中声明名称空间,但是找不到解决我问题的好方法...

Did you try to rebuild the solution after adding the GraphSharp lib? 添加GraphSharp库之后,您是否尝试过重建解决方案? In order for the XAML designer/editor to see it, it needs to have the solution rebuilt. 为了让XAML设计者/编辑者可以看到它,它需要重新构建解决方案。 Otherwise it will give you an error stating it could not be found. 否则,它将给您一个错误,指出找不到它。

I just added the GraphSharp lib to a project and was able to use the same namespace you provided, so the namespace is valid. 我刚刚将GraphSharp库添加到项目中,并且能够使用您提供的相同名称空间,因此该名称空间有效。

Also make sure you have added a reference to the GraphSharp library in your project. 还要确保在项目中添加了对GraphSharp库的引用。 The best way to do this is via NuGet. 最好的方法是通过NuGet。 Right-Click on your project References and chose to add a new NuGet package. 右键单击项目引用,然后选择添加新的NuGet包。 Search for GraphSharp and install it. 搜索GraphSharp并安装它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM