public PivotItemViewModel(IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, IShellViewModel shellViewModelInstance, IRaumFeldService raumFeldServiceInstance, string label, string symbol, string startId, string searchId) { eventAggregator = eventAggregatorInstance; messagingService = messagingServiceInstance; shellViewModel = shellViewModelInstance; raumFeldService = raumFeldServiceInstance; this.startId = startId; this.searchId = searchId; if (string.IsNullOrEmpty(searchId)) { IsSearchEnabled = false; } else { IsSearchEnabled = true; } PivotLabel = label; PivotSymbol = symbol; Elements = new ObservableCollection <IElement>(); CacheElements = new ObservableCollection <IElement>(); ViewModel = this; InitializeCommand.Execute(null); }
public SettingsViewModel(INavigationService navigationServiceInstance, IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, ICachingService cachingServiceInstance, IRaumFeldService raumFeldServiceInstance) { navigationService = navigationServiceInstance; eventAggregator = eventAggregatorInstance; messagingService = messagingServiceInstance; cachingService = cachingServiceInstance; raumFeldService = raumFeldServiceInstance; eventAggregator.GetEvent <SystemUpdateIDChangedEvent>().Subscribe(onSystemUpdateIDChanged, ThreadOption.UIThread); Presets = new ObservableCollection <Preset>(); ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; switch ((string)localSettings.Values["NAVIGATION"]) { case PageTokens.MyMusicPage: IsCheckedMyMusic = true; break; case PageTokens.FavoritesPage: IsCheckedFavorites = true; break; default: break; } }
public ManageZonesNavigationViewModel(IEventAggregator eventAggregatorInstance, IRaumFeldService raumFeldServiceInstance, IShellViewModel shellViewModel, string symbol, string pageIdentifier, string secondPageIdentifier = "") { eventAggregator = eventAggregatorInstance; raumFeldService = raumFeldServiceInstance; Parent = shellViewModel; Label = string.Empty; SymbolAsString = symbol; PageIdentifier = pageIdentifier; SecondPageIdentifier = secondPageIdentifier; IsEnabled = false; HasSecondFunction = true; }
public ShellViewModel(INavigationService navigationServiceInstance, IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, IRaumFeldService raumFeldServiceInstance) { navigationService = navigationServiceInstance; eventAggregator = eventAggregatorInstance; messagingService = messagingServiceInstance; raumFeldService = raumFeldServiceInstance; eventAggregator.GetEvent <SystemUpdateIDChangedEvent>().Subscribe(onSystemUpdateIDChanged, ThreadOption.UIThread); eventAggregator.GetEvent <RaumFerldZonesLoadedEvent>().Subscribe(onRaumFeldZonesLoaded, ThreadOption.UIThread); ZoneViewModels = new ObservableCollection <ZoneViewModel>(); ItemInvokedCommand = new DelegateCommand <NavigationViewItemInvokedEventArgs>(OnItemInvoked); }
public TuneInNavigationViewModel(IEventAggregator eventAggregatorInstance, IRaumFeldService raumFeldServiceInstance, IShellViewModel shellViewModel, string label, string symbol, string pageIdentifier) { eventAggregator = eventAggregatorInstance; raumFeldService = raumFeldServiceInstance; Parent = shellViewModel; eventAggregator.GetEvent <SystemUpdateIDChangedEvent>().Subscribe(onSystemUpdateIDChanged, ThreadOption.UIThread); Label = label; SymbolAsString = symbol; PageIdentifier = pageIdentifier; SecondPageIdentifier = string.Empty; HasSecondFunction = false; setIsEnabledCommand = new DelegateCommand <object>(async(param) => { IsEnabled = await raumFeldService.GetTuneInState(); }); setIsEnabledCommand.Execute(null); }
public ZoneViewModel(IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, IShellViewModel shellViewModelInstance, IRaumFeldService raumFeldServiceInstance, MediaRenderer zoneViewModelRendererInstance) { eventAggregator = eventAggregatorInstance; messagingService = messagingServiceInstance; shellViewModel = shellViewModelInstance; raumFeldService = raumFeldServiceInstance; zoneViewModelRenderer = zoneViewModelRendererInstance; RoomViewModels = new ObservableCollection <IRoomViewModel>(); ZoneViewModelTracks = new ObservableCollection <IElement>(); Name = zoneViewModelRendererInstance.Name != string.Empty ? zoneViewModelRendererInstance.Name : "UnassignedRooms".GetLocalized(); Udn = zoneViewModelRendererInstance.Udn != string.Empty ? zoneViewModelRendererInstance.Name : "UnassignedRooms".GetLocalized(); eventAggregator.GetEvent <MuteChangedEvent>().Subscribe(onMuteChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <VolumeChangedEvent>().Subscribe(onVolumeChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <RoomMutesChangedEvent>().Subscribe(onRoomMutesChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <RoomVolumesChangedEvent>().Subscribe(onRoomVolumesChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <AVTransportURIChangedEvent>().Subscribe(onAVTransportURIChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <AVTransportURIMetaDataChangedEvent>().Subscribe(onAVTransportURIMetaDataChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <CurrentTrackChangedEvent>().Subscribe(onCurrentTrackChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <CurrentTrackURIChangedEvent>().Subscribe(onCurrentTrackURIChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <CurrentPlayModeChangedEvent>().Subscribe(onCurrentPlayModeChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <CurrentTrackMetaDataChangedEvent>().Subscribe(onCurrentTrackMetaDataChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <CurrentTransportActionsChangedEvent>().Subscribe(onCurrentTransportActionsChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <NumberOfTracksChangedEvent>().Subscribe(onNumberOfTracksChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); eventAggregator.GetEvent <RoomStatesChangedEvent>().Subscribe(onRoomStatesChanged, ThreadOption.UIThread, false, device => device.MediaDevice == zoneViewModelRenderer); GetZoneVolumeCommand.Execute(null); GetZoneMuteCommand.Execute(null); GetCurrentTransportActionsCommand.Execute(null); GetTransportSettingsCommand.Execute(null); GetMediaInfoCommand.Execute(null); GetPositionInfoCommand.Execute(null); }