Skip to content

Instantly share code, notes, and snippets.

@bclinkinbeard
Created February 16, 2010 15:12
Show Gist options
  • Save bclinkinbeard/305583 to your computer and use it in GitHub Desktop.
Save bclinkinbeard/305583 to your computer and use it in GitHub Desktop.
package org.robotlegs.examples.imagegallery
{
// imports removed for brevity
public class ImageGalleryContext extends SignalContext
{
private const VIEW_PACKAGE:String = "org.robotlegs.examples.imagegallery.view.components";
private const LOAD_GALLERY:String = "loadGallery";
private var appStarted:ApplicationStartedSignal;
override public function startup():void
{
//map the views
viewMap.mapPackage(VIEW_PACKAGE);
//map the presentation models
injector.mapSingletonOf( IGalleryViewPresentationModel, GalleryViewPresentationModel );
injector.mapSingletonOf( IGalleryThumbnailsPresentationModel, GalleryThumbnailsPresentationModel );
//map the services and their factories
injector.mapSingletonOf( IGalleryImageService, XMLImageService );
injector.mapSingletonOf( IGalleryFactory, XMLGalleryFactory );
//map the signals
injector.mapSingleton(GalleryUpdatedSignal);
injector.mapSingleton(GalleryImageSelectedSignal);
ApplicationStartedSignal(signalCommandMap.mapSignalClass(
ApplicationStartedSignal, LoadGalleryCommand, true)).dispatch();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<swiz:Swiz xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:removed for brevity>
<swiz:config>
<swiz:SwizConfig viewPackages="org.robotlegs.examples.imagegallery.view.components" />
</swiz:config>
<swiz:beanProviders>
<swiz:BeanProvider>
<models:GalleryViewPresentationModel />
<models:GalleryThumbnailsPresentationModel />
<service:XMLImageService />
<factories:XMLGalleryFactory />
<signals:GalleryUpdatedSignal />
<signals:GalleryImageSelectedSignal />
<controller:LoadGalleryCommand />
</swiz:BeanProvider>
</swiz:beanProviders>
</swiz:Swiz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment