public DateTimeCellViewModel <T> AddDateTimeCell <T>(T data, Expression <Func <T, DateTime?> > property, string label, string placeholder = "", Icon placeholderIcon = Icon.None, string dateFormat = "dd/MM/yyyy", CellIndicators indicators = CellIndicators.None) where T : class { var cell = new DateTimeCellViewModel <T>(data, property) { Label = label, PlaceholderText = placeholder, PlaceholderIcon = placeholderIcon, Accessories = indicators, DateFormat = dateFormat, }; return(AddCell(cell)); }
public void SetParentHost(DateTimeCellViewModel host) { if (host == null) { throw new System.ArgumentNullException(nameof(host)); } if (_parentCell != null && _parentCell != host && _parentCell.PickerVisible) { // Hide the previous parent picker. _parentCell.ToggglePickerVisibility(); } _parentCell = host; if (_parentCell.Value.HasValue) { Date = _parentCell.Value.Value; } else { Date = DateTime.Now; } }
internal void ClearHost() { _parentCell.ToggglePickerVisibility(); _parentCell = null; }