WPF-PageFunctions.为什么需要它们? [英] WPF - PageFunctions. Why are they needed?

查看:182
本文介绍了WPF-PageFunctions.为什么需要它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在WPF中学习了几个月,我已经掌握了大部分内容以及使用它的原因/原因,但是我仍在努力查看PageFunction类的价值.

I've been dabbling in WPF for a couple of months now and I've managed to grasp most of what's about and why/when it's used but I'm still struggling to see the value of the PageFunction class.

有人可以给我一个简单而具体的示例,说明PageFunction何时可能是适合该工作的工具吗?

Can someone give me a simple, but concrete example of when a PageFunction might be the correct tool for the job?

推荐答案

主要,这似乎是在基于任务的UI中形式化分支的一种模式.

Mainly, it seems to be a pattern to formalize branching in task based UI.

假设您有一个带有选中标记的可选功能的表单,但是此功能需要其他信息,这些信息太复杂而无法容纳在同一页面上. 使用此模式可以将信息收集委派给另一个组件.

Let's say you have a form with a checkmark for an optional feature, but this feature requires additional information which is too complicated to fit on the same page. Using this pattern allows delegating information collection to another component.

此外,还应用了一种策略模式,因为您可能具有能够收集相同信息的各种子系统,它们都继承了PageFunction(of T),因此实际上调用那些子系统的代码不需要知道有关它的任何细节.

Moreover, there is kind of a strategy pattern applied, since you could have various subsystems able to collect the same information, all of them inheriting the PageFunction(of T), so that the code actually calling those does not need to know any detail about it.

这些只是一些想法,我没有仔细研究.

Those are just some ideas, I have not exactly looked into it.

这篇关于WPF-PageFunctions.为什么需要它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆