C# Class OS2Indberetning.ViewModel.GpsViewModel

Viewmodel of the GPS page. Handles all view logic
Inheritance: XLabs.Forms.Mvvm.ViewModel, INotifyPropertyChanged, IDisposable
显示文件 Open project: os2indberetning/OS2_Windows_Phone

Public Methods

Method Description
Dispose ( ) : void

Method that handles cleanup of the viewmodel

GpsIsAvailable ( ) : void

Method to do stuff when gps is not available

GpsNotAvailable ( ) : void

Method to do stuff when gps is not available

GpsViewModel ( ) : System

Constructor that handles initialization of the viewmodel

HandleAppearedMessage ( object sender ) : void

Method that handles the Appeared message

HandleFinishDriveMessage ( ) : void

Method that handles the FinishDrive message

HandleStopGpsMessage ( ) : void

Method that handles the StopGps message

HandleToggleGpsMessage ( ) : void

Method that handles the ToggleGps message

PauseDistanceTooBig ( double distance ) : void

Method that handles sending a PauseError

PositionChanged ( object sender, XLabs.Platform.Services.Geolocation.PositionEventArgs e ) : void

Method that handles change in positions from the gps signal

SetAccuracy ( double dist = null ) : void

Method to help with setting the correct text for Accuracy

SetupGps ( ) : void

Method that does the initial gps setup

TestForAvailibility ( ) : void

Method that checks for gps signal

TestGpsSignalTimer ( ) : void

Method that checks for gps signal when the gps in on pause The cause of this is to notify the user of gps signal even when he isnt tracking

Timer ( ) : void

Method that handles that tracks if gps signal have been missing for 30 seconds

Protected Methods

Method Description
OnPropertyChanged ( string propertyName ) : void

Private Methods

Method Description
CountDown ( ) : void

Method that does a countdown on the screen. Also makes sure the gps isnt tracked while countdown is active

HandleBackMessage ( ) : void

Method that handles the Back message

PositionError ( object sender, XLabs.Platform.Services.Geolocation.PositionErrorEventArgs e ) : void

Method that gets called when an error event is triggered in the locator

Subscribe ( ) : void

Method that handles subscribing to the needed messages

Unsubscribe ( ) : void

Method that handles unsubscribing

Method Details

Dispose() public method

Method that handles cleanup of the viewmodel
public Dispose ( ) : void
return void

GpsIsAvailable() public method

Method to do stuff when gps is not available
public GpsIsAvailable ( ) : void
return void

GpsNotAvailable() public method

Method to do stuff when gps is not available
public GpsNotAvailable ( ) : void
return void

GpsViewModel() public method

Constructor that handles initialization of the viewmodel
public GpsViewModel ( ) : System
return System

HandleAppearedMessage() public method

Method that handles the Appeared message
public HandleAppearedMessage ( object sender ) : void
sender object
return void

HandleFinishDriveMessage() public method

Method that handles the FinishDrive message
public HandleFinishDriveMessage ( ) : void
return void

HandleStopGpsMessage() public method

Method that handles the StopGps message
public HandleStopGpsMessage ( ) : void
return void

HandleToggleGpsMessage() public method

Method that handles the ToggleGps message
public HandleToggleGpsMessage ( ) : void
return void

OnPropertyChanged() protected method

protected OnPropertyChanged ( string propertyName ) : void
propertyName string
return void

PauseDistanceTooBig() public method

Method that handles sending a PauseError
public PauseDistanceTooBig ( double distance ) : void
distance double
return void

PositionChanged() public method

Method that handles change in positions from the gps signal
public PositionChanged ( object sender, XLabs.Platform.Services.Geolocation.PositionEventArgs e ) : void
sender object
e XLabs.Platform.Services.Geolocation.PositionEventArgs
return void

SetAccuracy() public method

Method to help with setting the correct text for Accuracy
public SetAccuracy ( double dist = null ) : void
dist double
return void

SetupGps() public method

Method that does the initial gps setup
public SetupGps ( ) : void
return void

TestForAvailibility() public method

Method that checks for gps signal
public TestForAvailibility ( ) : void
return void

TestGpsSignalTimer() public method

Method that checks for gps signal when the gps in on pause The cause of this is to notify the user of gps signal even when he isnt tracking
public TestGpsSignalTimer ( ) : void
return void

Timer() public method

Method that handles that tracks if gps signal have been missing for 30 seconds
public Timer ( ) : void
return void