protected override void OnResume() { base.OnResume(); MusicManager.Volume = preferences.MusicVolume / 100f; MusicManager.Resume(); if (locationHandler != null) { locationHandler.LocationPriority = LocationRequest.PriorityHighAccuracy; // If background updating is disabled, start listening for locations again if (!preferences.BackgroundUpdates) { locationHandler.Start(); } } googleMap?.SetMapStyle(MapStyleOptions.LoadRawResourceStyle(this, MapTheme)); // Enable or disable fullscreen mainView.SystemUiVisibility = (StatusBarVisibility)(preferences.Fullscreen ? SystemUiFlags.HideNavigation | SystemUiFlags.ImmersiveSticky | SystemUiFlags.Fullscreen : 0); }
/// <summary> /// Creates the DashboardViewModel instance. /// Sets the commands equal to a method to call. /// </summary> public DashboardViewModel(IReservationRepo reservationRepo, ISaleRepo saleRepo) { LocationHandler.Start(); LocationHandler.statusChanged += LocationHandler_statusChanged; weatherHandler = new Weather.WeatherHandler(); Time = DateTime.Now; DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(0.3); timer.Tick += Timer_Tick; timer.Start(); _reservationRepo = reservationRepo; _saleRepo = saleRepo; ChannelsMusic = MusicPlayer.channels; if (!MusicPlayer.channels.ContainsKey(Properties.Settings.Default.FavorityMusic)) // if the saved key of your favorite (last played) channel doens't exist, play Studio Brussel. { SelectedChannelMusic = getMusicChannelKeyValuePair("Studio Brussel"); } else { SelectedChannelMusic = getMusicChannelKeyValuePair(Properties.Settings.Default.FavorityMusic); } LastSelectedChannelMusic = SelectedChannelMusic; MusicPlayer.statusChanged += MusicPlayer_statusChanged; PlayOrPauseMusicCommand = new RelayCommand(PlayOrPauseMusic); VolumeDownMusicCommand = new RelayCommand(VolumeDownMusic); VolumeUpMusicCommand = new RelayCommand(VolumeUpMusic); VolumeMuteMusicCommand = new RelayCommand(MuteMusic); SelectedChannelMusicSelectionChangedCommand = new RelayCommand(SelectedChannelMusicSelectionChanged); }