Exemple #1
0
        void CheckFunctionalityAvailability()
        {
            var audioAvailable = AudioViewModel.AudioSource.AudioAvailable;

            var videoAvailable = VideoViewModel.SelectedVideoSourceKind != VideoSourceKind.NoVideo;

            RecordCommand.RaiseCanExecuteChanged(audioAvailable || videoAvailable);

            ScreenShotCommand.RaiseCanExecuteChanged(videoAvailable);
        }
Exemple #2
0
        void CheckFunctionalityAvailability()
        {
            var audioAvailable = Settings.Audio.Enabled;

            var videoAvailable = !(VideoViewModel.SelectedVideoSourceKind is NoVideoSourceProvider);

            RecordCommand.RaiseCanExecuteChanged(audioAvailable || videoAvailable);

            ScreenShotCommand.RaiseCanExecuteChanged(videoAvailable);
        }
Exemple #3
0
        //private void OnLocationServiceStatusChanged(object sender, LocationServiceStatusChangedEventArgs e)
        //{
        //}

        private async Task ViewLoaded()
        {
            _loading = true;

            var activityRecordingType = await _settingsService.GetStoredActivityRecordingTypeAsync();

            ActivityText = activityRecordingType.ToString();

            //TODO: Glenn - Better the GPS tracking based on sport type and during activity

            /*
             * Wondering about similar as questioned here: https://social.msdn.microsoft.com/Forums/en-US/ac03380d-4872-4161-b450-57a3c064f0a3/uwp-how-to-determine-if-a-device-has-gps-capabilities
             * For creating GPS tracking we want to be sure the user can only start that if accuracy is high enough
             * So wondering what the best threshold should be in meters...
             * AND how 'fast' I should set the recording milliseconds
             *
             * Some suggestions already given by Atley Hunter ( and I'm also seeing this in my Garmin GPX files )
             * Tweak the ReportInterval during the tracking, to ensure better app performance
             * Set Geolocator settings depending on cycling or running
             * Strava app will show halo around current location indicating accuracy, how smaller the halo, the more accurate the position ( would guess this is the distance in meter? )
             */

            //DistanceUnitType distanceUnitType = await _settingsService.GetStoredDistanceUnitTypeAsync();
            //SelectedMeasurementUnit = distanceUnitType.ToString();

            var accessStatus = await _locationService.RequestAccessAsync();

            switch (accessStatus)
            {
            case LocationServiceRequestResult.Allowed:
                var position = await _locationService.GetPositionAsync(LocationServiceAccuracy.High);

                if (!position.IsUnknown)
                {
                    _canRecord = true;
                    RecordCommand.RaiseCanExecuteChanged();
                    CurrentLocation = new Geopoint(new BasicGeoposition()
                    {
                        Latitude  = position.Latitude,
                        Longitude = position.Longitude
                    });
                }
                break;

            case LocationServiceRequestResult.Denied:
                //TODO: Glenn - Location request denied, show user information!
                break;
            }

            _loading = false;
        }