public MusicViewModel(Navigator navigator, ZoneService zoneService, ISonosMusicApi sonosMusicApi, IMessenger messageBus) : base(navigator, zoneService, sonosMusicApi, messageBus) { MessageBus.Register <CoordinatorChangedMessage>(this, CoordinatorChanged); var sonosFavorites = ContainerFactory.Create("FV:2", "", "Sonos Favorites", RouteSonosWp8.Favorites.Id, "/Assets/Dark/favs.png" /*/Assets/favorites-logo.jpg"*/); var sonosPlaylists = ContainerFactory.Create("SQ:", "", "Sonos Playlists", RouteSonosWp8.SonosPlaylists.Id, "/Assets/Dark/appbar.list.png" /*"/Assets/playlist-icon.png"*/); var musicLibrary = ContainerFactory.Create("A:", "", "Music Library", RouteSonosWp8.Library.Id, "/Assets/Dark/appbar.music.png" /*"/Assets/library-logo.png"*/); Items.Add(sonosFavorites); Items.Add(musicLibrary); Items.Add(sonosPlaylists); }
public void Initialize(PhoneApplicationFrame rootFrame) { // init navigation _routeProvider = new RouteProvider(RouteSonosWp8.Unknown); _navigator = new Navigator(_routeProvider, rootFrame); var networkName = GetNetWorkName(); // use network as prefix. this will enable caching of different networks _storage = new PersistentStorage(networkName); // save the current network in storage. _storage.Save("network", networkName); _zoneService = new ZoneService(Messenger.Default); // singletons ServiceFactory.Register <IMessenger, IMessenger>(() => Messenger.Default); ServiceFactory.Register <IRouteProvider, RouteProvider>(() => _routeProvider); ServiceFactory.Register <Navigator, Navigator>(() => _navigator); ServiceFactory.Register <IStorage, PersistentStorage>(() => _storage); ServiceFactory.Register <ZoneService, ZoneService>(() => _zoneService); ServiceFactory.Register <ISonosMusicApi, SonosMusicApi>(() => new SonosMusicApi(_zoneService, _storage)); }