如何将 WPF 用户控件创建为 dll,然后在另一个 WPF 应用程序中查看它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29607768/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I create WPF User Control as dll and then see it in another WPF application?
提问by Ilya Sandler
I created WPF User Control Library template but I don't know how to create dll and use it in another WPF application.
我创建了 WPF 用户控制库模板,但我不知道如何创建 dll 并在另一个 WPF 应用程序中使用它。
回答by sriman reddy
In Visual Studio, Click File -> New -> Visual C# -> Class Library to create add dll project.
在 Visual Studio 中,点击 File -> New -> Visual C# -> Class Library 来创建 add dll 项目。
Then, Right click the project and add WPF usercontrol. Later build it and add the dll as reference to your WPF project and use it.
然后,右键单击该项目并添加 WPF 用户控件。稍后构建它并添加 dll 作为对您的 WPF 项目的引用并使用它。

