Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 winRT 应用程序开发用户控件。我想避免大量重复代码,我想知道您是否知道针对属性和依赖属性进行代码编织的任何解决方案?我试过 Fody,但它不适用于依赖属性。我只是希望我的代码更流畅,更清晰,便于阅读和写作。
干杯
那么这取决于你的重复是什么:
您是否使用了多个使用相同 ItemTemplate 的 GridViews/Listview?如果是这种情况,则在其中创建一个包含您的代码的 DataTemplate。
您是否要一遍又一遍地在 GridView/ListView 之外显示相同类型的信息,也许考虑创建一个 UserControl?