public static async Task <Geoposition> GetPosition(uint accuracyInMeters = 0) { WaitingPanelHelper.ShowWaitingPanel("正在定位,请稍后...", Visibility.Visible); bool access = await IsLocationCanAccess(); if (access) { //if the Location Premission is Access Geolocator locator = new Geolocator() { DesiredAccuracy = PositionAccuracy.Default, DesiredAccuracyInMeters = accuracyInMeters, }; var position = await locator.GetGeopositionAsync(); WaitingPanelHelper.HiddenWaitingPanel(); return(position); } else { WaitingPanelHelper.HiddenWaitingPanel(); await new MessageDialog("定位失败! 如有需要,可前往设置打开定位").ShowAsync(); return(null); } }
private void BackRequested(object eventArgs) { if (WaitingPanelHelper.IsWaitingPanelExisted()) { WaitingPanelHelper.HiddenWaitingPanel(); if (formAction != null) { formAction.Absort(); } setArgsHandleTrue(eventArgs); } var page = CommonHelper.HostPage; if (page != null && page.CanGoBack) { page.GoBack(); setArgsHandleTrue(eventArgs); } }