async public Task InitializeAsync(Geopoint center) { Center = center; streetview_map.Center = Center; if (streetview_map.IsStreetsideSupported) { var street_panorama = await StreetsidePanorama.FindNearbyAsync(streetview_map.Center); var street_exp = new StreetsideExperience(street_panorama); street_exp.OverviewMapVisible = true; streetview_map.CustomExperience = street_exp; } else { NotSupported?.Invoke(); } _core_appview.TitleBar.ExtendViewIntoTitleBar = true; //size the window _appview.SetPreferredMinSize(new Size(500, 400)); //set background _appview.TitleBar.ButtonBackgroundColor = Colors.Transparent; _appview.TitleBar.ButtonForegroundColor = Colors.White; _appview.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent; _appview.TitleBar.ButtonInactiveForegroundColor = Colors.White; rect_titlebar.Fill = new SolidColorBrush(TitlebarColor); Window.Current.SetTitleBar(rect_titlebar); }
/// <summary> /// Initializes the service. /// </summary> public void Init() { if (!OrientationSensor.IsSupported) { NotSupported?.Invoke(this, null); return; } _orientationSensor = new OrientationSensor(); _orientationSensor.Interval = 10; _orientationSensor.DataUpdated += OnDataUpdated; }
/// <summary> /// Initializes HeartRateMonitorService class. /// Invokes NotSupported event if heart rate sensor is not supported. /// </summary> public void Init() { try { _hrm = new HRM { Interval = 1000, PausePolicy = SensorPausePolicy.None }; _hrm.DataUpdated += OnDataUpdated; } catch (Exception) { NotSupported?.Invoke(this, EventArgs.Empty); } }
/// <summary> /// Handles "NotSupported" of the HeartRateMonitorService object. /// Invokes "NotSupported" to other application's modules. /// </summary> /// <param name="sender">The object that raised the event.</param> /// <param name="args">Event arguments. Not used.</param> private void OnServiceNotSupported(object sender, EventArgs args) { NotSupported?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Handles "NotSupported" event of the sensor service. /// Invokes "NotSupported" event. /// </summary> /// <param name="sender">Instance of the object which invoked the event.</param> /// <param name="eventArgs">Event data.</param> private void OnNotSupported(object sender, EventArgs eventArgs) { NotSupported?.Invoke(this, null); }