Example #1
0
        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));
        }
Example #2
0
        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;
            }
        }
Example #3
0
 internal void ClearHost()
 {
     _parentCell.ToggglePickerVisibility();
     _parentCell = null;
 }