Beispiel #1
0
        public async Task <List <TItem> > Load(
            TCommonCriteria criteria
            , Framework.Queries.QueryPagingSetting queryPagingSetting
            , Framework.Queries.QueryOrderBySetting queryOrderBySetting
            , Func <TableQuery <TSQLiteItem>, Framework.Queries.QueryOrderDirections, TableQuery <TSQLiteItem> > sortFunction)
        {
            var predicate = GetSQLiteTableQueryPredicate_Common(criteria);

            var tableQuery = _database.Table <TSQLiteItem>().Where(predicate);

            if (sortFunction != null)
            {
                tableQuery = sortFunction(tableQuery, queryOrderBySetting.Direction);
            }

            tableQuery = tableQuery.Skip((queryPagingSetting.CurrentPage - 1) * queryPagingSetting.PageSize).Take(queryPagingSetting.PageSize);

            return
                (await Task.FromResult((from t in tableQuery
                                        select(TItem) t).ToList()));
        }
 protected static Framework.Xaml.ActionForm.SortActionItemModel GetShowListFullScreenActionSheetActionItemModel_Sort(ICommand command, Framework.Queries.QueryOrderBySetting selectedQueryOrderBySetting)
 {
     return(new Framework.Xaml.ActionForm.SortActionItemModel
     {
         ActionFormItemType = Framework.Xaml.ActionForm.ActionFormItemTypes.SortCommandItem,
         Title = selectedQueryOrderBySetting.DisplayName,
         FontIconSettings = new Framework.Xaml.FontIconSettings {
             MasterFontIcon = selectedQueryOrderBySetting.FontIcon, MasterFontIconFamily = selectedQueryOrderBySetting.FontIconFamily.ToString()
         },
         QueryOrderBySetting = selectedQueryOrderBySetting,
         Command = command,
         Position = 10,
     });
 }