33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Windows.Media;
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
using Color = System.Drawing.Color;
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
{
|
|
public class AppointmentCategoryListVM : AbstractDCListMapperVM<AppointmentCategoryDC, AppointmentCategoryVM>
|
|
{
|
|
|
|
public AppointmentCategoryListVM(List<AppointmentCategoryDC> pDCs)
|
|
: base(pDCs)
|
|
{
|
|
}
|
|
|
|
public List<SolidColorBrush> AllBrushes
|
|
{
|
|
get
|
|
{
|
|
var lTemp = typeof(Color).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Static).Select(pi => (Color)pi.GetGetMethod().Invoke(null, null)).ToList();
|
|
|
|
lTemp.Sort((x, y) => x.GetBrightness().CompareTo(y.GetBrightness()));
|
|
|
|
return lTemp.Select(c => new SolidColorBrush(System.Windows.Media.Color.FromArgb(c.A, c.R, c.G, c.B))).ToList();
|
|
}
|
|
}
|
|
|
|
}
|
|
} |