/
SortParameterData.cs
44 lines (35 loc) · 1.37 KB
/
SortParameterData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DynamicData.Binding;
namespace Trader.Domain.Model
{
public class SortParameterData : AbstractNotifyPropertyChanged
{
private readonly IList<SortContainer> _sortItems = new ObservableCollection<SortContainer>
{
new SortContainer("Customer, Currency Pair", SortExpressionComparer<TradeProxy>
.Ascending(l => l.Customer)
.ThenByAscending(p => p.CurrencyPair)
.ThenByAscending(p => p.Id)),
new SortContainer("Currency Pair, Amount", SortExpressionComparer<TradeProxy>
.Ascending(l => l.CurrencyPair)
.ThenByDescending(p => p.Amount)
.ThenByAscending(p => p.Id)),
new SortContainer("Recently Changed", SortExpressionComparer<TradeProxy>
.Descending(l => l.Timestamp)
.ThenByAscending(p => p.Customer)
.ThenByAscending(p => p.Id))
};
private SortContainer _selectedItem;
public SortParameterData()
{
SelectedItem = _sortItems[2];
}
public SortContainer SelectedItem
{
get => _selectedItem;
set => SetAndRaise(ref _selectedItem, value);
}
public IEnumerable<SortContainer> SortItems => _sortItems;
}
}