本文整理汇总了C#中BindableCollection.OrderBy方法的典型用法代码示例。如果您正苦于以下问题:C# BindableCollection.OrderBy方法的具体用法?C# BindableCollection.OrderBy怎么用?C# BindableCollection.OrderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BindableCollection
的用法示例。
在下文中一共展示了BindableCollection.OrderBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResultTable
private void ResultTable(BindableCollection<Listing> propertyList, Document doc)
{
iTextSharp.text.Font PropertyFont = new iTextSharp.text.Font();
iTextSharp.text.Font headerfont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 18f, iTextSharp.text.Font.BOLD);
propertyList = (BindableCollection<Listing>)propertyList.OrderBy(x => x.Address).ToObservableCollection();
//Creating a table, and adding items dynamically
PdfPTable resultTable = new PdfPTable(8);
resultTable.TotalWidth = PageSize.A4.Width;
resultTable.LockedWidth = true;
PdfPCell header = new PdfPCell(new Phrase("Søgeresultatliste\n", headerfont));
header.Colspan = 8;
header.PaddingBottom = 10f;
resultTable.AddCell(header);
resultTable.SetWidths(new float[] { 20f, 40f, 20f, 20f, 20f, 20f, 20f, 20f, });
resultTable.AddCell("Boligtype");
resultTable.AddCell("Adresse");
resultTable.AddCell("By/Postnr");
resultTable.AddCell("Pris");
resultTable.AddCell("Størrelse");
resultTable.AddCell("Liggetid");
resultTable.AddCell("Til salg/Solgt");
resultTable.AddCell("Byggeår");
for (int i = 0; i < NumberOfSearchResults; i++)
{
if (propertyList[1].IsSelected)
{
var item = propertyList[i];
resultTable.AddCell(item.PropertyType);
PdfPCell adresscell = new PdfPCell(new Phrase(item.Address));
resultTable.AddCell(adresscell);
resultTable.AddCell(item.Town + "(" + item.AreaCode + ")");
resultTable.AddCell(item.Price.ToString());
resultTable.AddCell(item.Size.ToString());
resultTable.AddCell(item.Demurrage.ToString());
resultTable.AddCell(item.ForSaleSold);
resultTable.AddCell(item.YearBuilt.ToString());
}
}
if (resultTable != null)
{
doc.Add(resultTable);
}
}
示例2: PrepareSortFilterPopup
public void PrepareSortFilterPopup(int id)
{
FilterViewModel filter = FiltersList.FirstOrDefault(f => f.columnId == id);
if (filter == null)
{
List<string> breakdownData = GetBreakdownDataValues(id);
BindableCollection<FilterCriteriaViewModel> filterCriteria = new BindableCollection<FilterCriteriaViewModel>();
foreach (string criteria in breakdownData)
{
filterCriteria.Add(new FilterCriteriaViewModel(id, criteria, this));
}
try
{
filterCriteria = new BindableCollection<FilterCriteriaViewModel>(filterCriteria.OrderBy(x => Convert.ToInt32(x.Name)));
}
catch
{
filterCriteria = new BindableCollection<FilterCriteriaViewModel>(filterCriteria.OrderBy(x => x.Name));
}
filter = new FilterViewModel(id, Parameter.playlist.displayColumns[id], SortType.None, filterCriteria, this);
}
else
{
filter.setSortType(filter.sortType);
filter.RemoveButtonVisibility = "Visible";
filter.CloseButtonVisibility = "Collapsed";
}
SelectedFilter = filter;
}