Пример #1
0
        private async void GetTimeAsync()
        {
            loading.IsActive = true;
            Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

            try
            {
                ReturnDTO <RealTime> realTime = null;

                realTime = await UtilWebService.GetTimeAsync(this, UtilWebService.UrlPath);

                App.RealTime = realTime.Value;

                if (!realTime.Return)
                {
                    UtilMessage.ShowMessage <RealTime>(realTime);
                    pvtTime.Title = realTime.ReturnMessage;
                }
                else
                {
                    pvtTime.Title = "Last refresh: " + realTime.Value.timeList.lastRefresh;
                    CleanAllGrids();

                    FillGrids();
                }
            }
            catch (Exception)
            {
                UtilMessage.PopUpMessage("Error", "Error");
            }
            finally
            {
                loading.IsActive = false;
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
            }
        }