Ejemplo n.º 1
0
        async Task <bool> ExecuteLoadTableRowsAsync(bool force = false)
        {
            if (IsBusy)
            {
                return(false);
            }

            try
            {
                IsBusy           = true;
                NoTableRowsFound = false;

                if (force)
                {
                }
                TableRows.Clear();

                // Initialize a default TableQuery to retrieve all the entities in the table.
                TableQuery tableQuery = new TableQuery().Select(new string[] { "PartitionKey", "RowKey" });
                tableQuery.TakeCount = RowsLoadedCount > recordsToLoadPerTime ? RowsLoadedCount : recordsToLoadPerTime;
                var result = await Table.BaseTable.ExecuteQuerySegmentedAsync(tableQuery, null);

                TableRows.AddRange(result);
                RowsLoadedCount = result.Count();
                SortTableRows();
                if (SortedTableRows.Count == 0)
                {
                    NoTableRowsFoundMessage = "No Rows Found";
                    NoTableRowsFound        = true;
                }
                else
                {
                    NoTableRowsFound = false;
                }
            }
            catch (Exception ex)
            {
                Logger.Report(ex, "Method", "ExecuteLoadTableRowsAsync");
                MessagingService.Current.SendMessage(MessageKeys.Error, ex);
            }
            finally
            {
                IsBusy = false;
            }
            return(true);
        }
Ejemplo n.º 2
0
 public void ClearTable()
 {
     TableRows.Clear();
 }