예제 #1
0
        async Task ExecuteLoadBirdLogsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                var _birdLog = await BirdWatcherLogService.GetBirdLogsAsync();

                foreach (var tmpBirdLog in _birdLog.items)
                {
                    BirdLogEntry tmpBLE = new BirdLogEntry();

                    tmpBLE.birdLogID = tmpBirdLog.birdLogID;
                    tmpBLE.LogDate   = tmpBirdLog.timestamp.ToString("MM/dd/yyyy");
                    if (Settings.Use24Hour)
                    {
                        tmpBLE.LogTime = tmpBirdLog.timestamp.ToString("HH:mm");
                    }
                    else
                    {
                        tmpBLE.LogTime = tmpBirdLog.timestamp.ToString("hh:mm tt");
                    }
                    if (!String.IsNullOrEmpty(tmpBirdLog.picture))
                    {
                        //tmpBLE.LogImage = ImageSource.FromUri(new Uri("http://" + Settings.ServerAddress + "/images/captured/" + tmpBirdLog.picture));
                        tmpBLE.LogImage = new UriImageSource {
                            CachingEnabled = false, Uri = new Uri("http://" + Settings.ServerAddress + "/images/captured/" + tmpBirdLog.picture)
                        };
                    }

                    BirdLog.Add(tmpBLE);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #2
0
        public async void OnItemTapped(object sender, ItemTappedEventArgs args, INavigation myNav)
        {
            BirdLogEntry selectedBirdLog = args.Item as BirdLogEntry;

            await myNav.PushAsync(new BirdLogDetailPage(new BirdLogDetailViewModel(selectedBirdLog.birdLogID)));
        }