protected override string FormatValueAsString(TValue value) { if (Format == null && EnableTime == false) { return(SwitchT.FormatValueAsString(value, System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)); } return(SwitchT.FormatValueAsString(value, Format)); }
protected IEnumerable <MatAutocompleteItem <TValue, TItem> > GetFilteredCollection(string searchText) { return(Items.Select(x => new MatAutocompleteItem <TValue, TItem>() { Value = ComputeItemValue(x), Item = x }) .Where(x => string.IsNullOrEmpty(searchText) || (SwitchT.FormatValueAsString(x.Value, Format)?.ToLowerInvariant().Contains(searchText?.ToLowerInvariant()) == true)) .Take(NumberOfElementsInPopup ?? DefaultsElementsInPopup)); }