Xomega provides a convenient way to generate an XML file that contains all static enumerations defined in the model, which you can use to populate a lookup cache in the Xomega Framework. This will effectively make your model enumerations instantly accessible to your application code.
The following steps describe how to generate an XML file with static enumerations.
- Open the Properties tab of the Enumeration Data XML generator in the Static Data folder.
- Set the Output Path parameter to where you want the generated file to go, for example ../MyProject.Client.Services/enumerations.xml.
- If you want the generator to automatically add the generated file to one of your projects as an embedded resource, then you need to specify the path to the project file in the Add To Project parameter.
- If you want to additionally add a link to the generated file into one of the projects as an embedded resource, then you can set the Link Into Project attribute to point to that project's file. This is useful for Silverlight solutions, where you cannot simply reference a project that is not built for Silverlight from another Silverlight project, but you can link the file into that project to use the same code base.
- If you need to link the generated file into another project as described in the previous step, you can also specify a virtual folder in the project structure to group the linked file by setting the Link Path attribute.
- Run the generator and add or link the generated file to your project as necessary.
- Add code to load that generated XML file into the look up cache and run the application to make sure the file was generated properly.