简体   繁体   English

如何打包自定义 UWP 模板化控件以在其他项目中重复使用,并可能供其他人使用?

[英]How do I package a custom UWP templated control for reuse in other projects, and maybe for others to use?

How do I package a custom UWP control for reuse in other projects, and maybe for others to use?如何打包自定义 UWP 控件以在其他项目中重复使用,并可能供其他人使用?

For example, I have a custom text editor that I would like to reuse without much hassle.例如,我有一个自定义文本编辑器,我想轻松地重用它。 So far I have just been putting all of my custom templated controls within my main project source code.到目前为止,我只是将所有自定义模板化控件放在我的主项目源代码中。

If I needed to reuse some control I would go through the tedious process of copying and pasting, etc., and i just feel like it is not the elegant/clean approach.如果我需要重用一些控件,我会经历复制和粘贴等繁琐的过程,我只是觉得这不是优雅/干净的方法。

Remember that I need a UWP approach here.请记住,我在这里需要一种 UWP 方法。 Thanks.谢谢。 ;) ;)

How do I package a custom UWP control for reuse in other projects, and maybe for others to use?如何打包自定义 UWP 控件以在其他项目中重复使用,并可能供其他人使用?

In this case, you can upload your custom templated controls to NuGet package.在这种情况下,您可以将自定义模板化控件上传到 NuGet 包。 And then can install it in other projects or for others to use it.然后可以将其安装在其他项目中或供其他人使用。 About how to create UI controls as NuGet packages, you can refer to this document .关于如何将 UI 控件创建为 NuGet 包,可以参考这个文档

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

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