public ColorCheckButton(ChartM.Legend Legend, Action <int, bool> SearchForItem, Color color) { InitializeComponent(); this.Legend = Legend; this.SearchForItem = SearchForItem; this.Color = new SolidColorBrush(color); this.DataContext = this; }
protected internal bool Compare(object value, ChartM.Legend item1 = null, DateTime?item2 = null) { if (item1 != null) { if (item1.GetType().GetProperty(Argument).PropertyType == typeof(DateTime)) { return(((DateTime)item1.GetType().GetProperty(Argument).GetValue(item1)).Date == ((DateTime)value).Date); } else { return((int)item1.GetType().GetProperty(Argument).GetValue(item1) == Convert.ToInt32(value)); } } else { return(((DateTime)item2).Date == ((DateTime)value).Date); } }