Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 9
    If OP gets up to 10+ views, a parameter-per-view is going to become impossible to maintain. Your point about compile-time errors is correct, but this is a very unmaintainable solution, unfortunately. Commented Aug 17, 2015 at 15:02
  • 3
    @ChrisCirefice: If the number of views grows, you can create some kind of "ViewState" object/class, which enforces this invariant. Then use that for switching etc. With so many views, some kind of manager object probably makes sense anyway. Commented Aug 17, 2015 at 23:58