public MetricsViewModel() { service = new WindowsPhoneServiceProducao.WindowsPhoneServiceClient(); percurso = new Percurso(); perNeg = new PercursoNegocio(); confNeg = new ConfiguracaoNegocio(); }
public PercursoViewModel() { service = new WindowsPhoneServiceProducao.WindowsPhoneServiceClient(); percurso = new Percurso(); percursoApre = new PercursoApresentacao(); perNeg = new PercursoNegocio(); confNeg = new ConfiguracaoNegocio(); _percursoApre = new PercursoApresentacao(); _percursos = new ObservableCollection <Percurso>(); _percursosLista = new ObservableCollection <PercursoApresentacao>(); _location = new ObservableCollection <GeoPosition <GeoCoordinate> >(); }
// Constructor public MetricsView() { InitializeComponent(); //para rodar com a tela bloqueada. PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; ViewModel = new MetricsViewModel(); ViewModel.InicializaListas(); //Instatiate watcher, setting its accuracy level and movement threshold. watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // using high accuracy. watcher.MovementThreshold = 25.0f; // meters of change before "PositionChanged" event fires. // wire up event handlers watcher.StatusChanged += new EventHandler <GeoPositionStatusChangedEventArgs>(watcher_statusChanged); watcher.PositionChanged += new EventHandler <GeoPositionChangedEventArgs <GeoCoordinate> >(watcher_PositionChanged); // start up the Location Service on app startup. watcher_StatusChanged // will fire when start up of LocServ is complete. new Thread(startLocServInBackground).Start(); //statusTextBlock.Text = "Starting Location Service..."; Timer = new System.Windows.Threading.DispatcherTimer(); Timer.Interval = new TimeSpan(0, 0, 0, 1); Timer.Tick += new EventHandler(Timer_Tick); //Linha de percurso linha = new MapPolyline(); linha.Stroke = new SolidColorBrush(Colors.Yellow); linha.StrokeThickness = 5; linha.Opacity = 0.8; map1.Children.Add(linha); _path = new LocationCollection(); Configuracao = new ConfiguracaoNegocio(); //Configurção IsMetrico = Configuracao.ConfIsMetrico(); Peso = Configuracao.ConfiPeso(); }