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.
如何将可视状态管理与自定义控件模板分开?
我有一个自定义控件,但在模板中放置了几个不同的面孔。所有模板必须具有相同的基于状态的可视化。有没有办法只设置一次我的 VSM?否则我需要在每个模板中复制 VSM 代码。
重新模板通常会导致重复代码,尤其是对于 VSM 代码。不幸的是,今天没有一种简单的方法可以抽象出该代码。