Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - PageFunctions. Why are they needed?

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.

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

like image 204
EightyOne Unite Avatar asked Jan 24 '23 18:01

EightyOne Unite


1 Answers

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.

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.

like image 65
Denis Troller Avatar answered Jan 30 '23 15:01

Denis Troller