How to register a custom view engine in magellan?

249 Views Asked by At

I'm all new to magellan, and as an attempt to learn it, I've built a custom view engine for supporting windows forms as specified in the documentation at codeplex. But how to register this new ViewEngine? There it is given,

ViewEngines.Engines.Add(new FormsViewEngine(new DefaultViewActivator()));

But what I can see is that, ViewEngines is not a Static Class and moreover it does not have a Engines Property. I know I'm missing something, but what is it?

So, How to register my ViewEngine to Magellan? Where and When should I register it?

PS: I'm using the latest update of magellan.

2

There are 2 best solutions below

0
Paul Stovell On BEST ANSWER

You are correct, the view engines are now configured on the ControllerRouteCatalog.

One of the goals in Magellan 2.0 was to reduce the number of static locators.

2
Mat J On

Seems like things have changed a bit. A few search for references of ViewEngine Class in the Magellan source gave the answer.

Now ViewEngines just provide default collection and no more handles ViewEngine registrations. I managed to create my own ViewEngineCollection and pass it to the contructor of ControllerRouteCatalog.

My bad, I should have done that before. Thanks anyway.