private object GetFilterItemValue(FilterItem y, FilterItem m, FilterItem d) { if (y.GetType() == typeof(DateTime)) { return(new DateTime((int)y.Content, (int)m.Content, (int)d.Content)); } if (y.GetType() == typeof(DateOnly)) { return(new DateOnly((int)y.Content, (int)m.Content, (int)d.Content)); } else { throw new InvalidCastException(y.GetType().FullName); } }
/// <summary> /// Check or uncheck parents or children /// </summary> private void VerifyCheckedState(FilterItem item) { bool?state = null; for (var i = 0; i < item.Children?.Count; ++i) { var current = item.Children[i].IsChecked; if (i == 0) { state = current; } else if (state != current) { state = null; break; } } this.SetIsChecked(item, state, false, true); }