private StopZoneDouble ConvertZoneTodouble(StopZone zone) { StopZoneDouble stDouble = new StopZoneDouble(); if (zone == null) { return(stDouble); } if (GetQuarter(zone.From) == Quarter.TopRight) { stDouble.From = 40 - (zone.From.Z * 10); } else if (GetQuarter(zone.From) == Quarter.TopLeft) { stDouble.From = -(zone.From.Z * 10); } else if (GetQuarter(zone.From) == Quarter.DownLeft) { stDouble.From = 20 - (-(zone.From.Z * 10)); } else if (GetQuarter(zone.From) == Quarter.DownRight) { stDouble.From = 20 + (zone.From.Z * 10); } if (GetQuarter(zone.To) == Quarter.TopRight) { stDouble.TO = 40 - (zone.To.Z * 10); } else if (GetQuarter(zone.To) == Quarter.TopLeft) { stDouble.TO = -(zone.To.Z * 10); } else if (GetQuarter(zone.To) == Quarter.DownLeft) { stDouble.TO = 20 - (-(zone.To.Z * 10)); } else if (GetQuarter(zone.To) == Quarter.DownRight) { stDouble.TO = 20 + (zone.To.Z * 10); } return(stDouble); }
// Constructor public TiltNavigation(MapView map) { _accelerometer = Accelerometer.GetDefault(); _isFirstTime = true; _map = map; _map.ExtentChanged += _map_ExtentChanged; /////Define Portarte Default Stop Zone///// _portrateStopZone = new StopZone(); _portrateStopZone.From = new AccelerometerPoint(0.0f, 0.7f, -0.3f); _portrateStopZone.To = new AccelerometerPoint(0.0f, 0.7f, 0.3f); _panDirection = Directions.None; if (_myDispatcherTimer == null) { _myDispatcherTimer = new DispatcherTimer(); _myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 0); // 100 Milliseconds _myDispatcherTimer.Tick += _myDispatcherTimer_Tick; } }