Example #1
0
		public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
		{
			var entryCell = (EntryCell)item;

			var tvc = reusableCell as EntryCellTableViewCell;
			if (tvc == null)
				tvc = new EntryCellTableViewCell(item.GetType().FullName);
			else
			{
				tvc.Cell.PropertyChanged -= OnCellPropertyChanged;
				tvc.TextFieldTextChanged -= OnTextFieldTextChanged;
				tvc.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;
			}

			SetRealCell(item, tvc);

			tvc.Cell = item;
			tvc.Cell.PropertyChanged += OnCellPropertyChanged;
			tvc.TextFieldTextChanged += OnTextFieldTextChanged;
			tvc.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;

			WireUpForceUpdateSizeRequested(item, tvc, tv);

			UpdateBackground(tvc, entryCell);
			UpdateLabel(tvc, entryCell);
			UpdateText(tvc, entryCell);
			UpdateKeyboard(tvc, entryCell);
			UpdatePlaceholder(tvc, entryCell);
			UpdateLabelColor(tvc, entryCell);
			UpdateHorizontalTextAlignment(tvc, entryCell);
			UpdateIsEnabled(tvc, entryCell);

			return tvc;
		}
        public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
        {
            EntryCell entryCell = (EntryCell)item;
            EntryCellTableViewCell entryCellTableViewCell = reusableCell as EntryCellTableViewCell;

            if (entryCellTableViewCell != null)
            {
                entryCellTableViewCell.Cell.PropertyChanged      -= OnCellPropertyChanged;
                entryCellTableViewCell.TextFieldTextChanged      -= OnTextFieldTextChanged;
                entryCellTableViewCell.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;
            }
            else
            {
                entryCellTableViewCell = new EntryCellTableViewCell(item.GetType().FullName);
            }
            SetMyRealCell(item, entryCellTableViewCell);
            entryCellTableViewCell.Cell = item;
            entryCellTableViewCell.Cell.PropertyChanged      += OnCellPropertyChanged;
            entryCellTableViewCell.TextFieldTextChanged      += OnTextFieldTextChanged;
            entryCellTableViewCell.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;
            base.WireUpForceUpdateSizeRequested(item, entryCellTableViewCell, tv);
            base.UpdateBackground(entryCellTableViewCell, entryCell);
            UpdateLabel(entryCellTableViewCell, entryCell);
            UpdateText(entryCellTableViewCell, entryCell);
            UpdateKeyboard(entryCellTableViewCell, entryCell);
            UpdatePlaceholder(entryCellTableViewCell, entryCell);
            UpdateLabelColor(entryCellTableViewCell, entryCell);
            UpdateHorizontalTextAlignment(entryCellTableViewCell, entryCell);
            UpdateIsEnabled(entryCellTableViewCell, entryCell);
            return(entryCellTableViewCell);
        }
Example #3
0
 static void UpdateIsEnabled(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.UserInteractionEnabled  = entryCell.IsEnabled;
     cell.TextLabel.Enabled       = entryCell.IsEnabled;
     cell.DetailTextLabel.Enabled = entryCell.IsEnabled;
     cell.TextField.Enabled       = entryCell.IsEnabled;
 }
 private static void UpdateText(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     if (cell.TextField.Text == entryCell.Text)
     {
         return;
     }
     cell.TextField.Text = entryCell.Text;
 }
Example #5
0
 static void UpdateText(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     if (cell.TextField.Text == entryCell.Text)
     {
         return;
     }
     // double sets side effect on iOS, YAY
     cell.TextField.Text = entryCell.Text;
 }
        public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
        {
            EntryCellEx entryCell = (EntryCellEx)item;
            EntryCellTableViewCell entryCellTableViewCell = reusableCell as EntryCellTableViewCell;
            if (entryCellTableViewCell != null)
            {
                entryCellTableViewCell.Cell.PropertyChanged -= OnCellPropertyChanged;
                entryCellTableViewCell.TextFieldTextChanged -= OnTextFieldTextChanged;
                entryCellTableViewCell.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;

                var oldCell = entryCellTableViewCell.Cell as EntryCellEx;
                if (oldCell != null)
                {
                    oldCell.FocusRequested -= EntryCell_FocusRequested;
                }
            }
            else
            {
                entryCellTableViewCell = new EntryCellTableViewCell(item.GetType().FullName);
            }

            SetMyRealCell(item, entryCellTableViewCell);
            entryCellTableViewCell.Cell = item;
            entryCellTableViewCell.Cell.PropertyChanged += OnCellPropertyChanged;
            entryCell.FocusRequested += EntryCell_FocusRequested;
            entryCellTableViewCell.TextFieldTextChanged += OnTextFieldTextChanged;
            entryCellTableViewCell.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;
            base.UpdateBackground(entryCellTableViewCell, entryCell);
            UpdateLabel(entryCellTableViewCell, entryCell);
            UpdateText(entryCellTableViewCell, entryCell);
            UpdateKeyboard(entryCellTableViewCell, entryCell);
            UpdatePlaceholder(entryCellTableViewCell, entryCell);
            UpdateLabelColor(entryCellTableViewCell, entryCell);
            UpdateXAlign(entryCellTableViewCell, entryCell);
            UpdateIsEnabled(entryCellTableViewCell, entryCell);

            if (entryCell.RequestInitialFocus)
            {
                entryCellTableViewCell.TextField.BecomeFirstResponder();
                entryCell.RequestInitialFocus = false;
            }

            return entryCellTableViewCell;
        }
        private static void OnCellPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            EntryCell entryCell             = (EntryCell)sender;
            EntryCellTableViewCell realCell = (EntryCellTableViewCell)GetMyRealCell(entryCell);

            if (e.PropertyName == EntryCell.LabelProperty.PropertyName)
            {
                UpdateLabel(realCell, entryCell);
                return;
            }
            if (e.PropertyName == EntryCell.TextProperty.PropertyName)
            {
                UpdateText(realCell, entryCell);
                return;
            }
            if (e.PropertyName == EntryCell.PlaceholderProperty.PropertyName)
            {
                UpdatePlaceholder(realCell, entryCell);
                return;
            }
            if (e.PropertyName == EntryCell.KeyboardProperty.PropertyName)
            {
                UpdateKeyboard(realCell, entryCell);
                return;
            }
            if (e.PropertyName == EntryCell.LabelColorProperty.PropertyName)
            {
                UpdateLabelColor(realCell, entryCell);
                return;
            }
            if (e.PropertyName == EntryCell.HorizontalTextAlignmentProperty.PropertyName)
            {
                UpdateHorizontalTextAlignment(realCell, entryCell);
                return;
            }
            if (e.PropertyName == Cell.IsEnabledProperty.PropertyName)
            {
                UpdateIsEnabled(realCell, entryCell);
            }
        }
Example #8
0
        public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
        {
            var entryCell = (EntryCell)item;

            var tvc = reusableCell as EntryCellTableViewCell;

            if (tvc == null)
            {
                tvc = new EntryCellTableViewCell(item.GetType().FullName);
            }
            else
            {
                tvc.PropertyChanged           -= HandlePropertyChanged;
                tvc.TextFieldTextChanged      -= OnTextFieldTextChanged;
                tvc.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;
            }

            SetRealCell(item, tvc);

            tvc.Cell                       = item;
            tvc.PropertyChanged           += HandlePropertyChanged;
            tvc.TextFieldTextChanged      += OnTextFieldTextChanged;
            tvc.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;

            WireUpForceUpdateSizeRequested(item, tvc, tv);

            UpdateBackground(tvc, entryCell);
            UpdateLabel(tvc, entryCell);
            UpdateText(tvc, entryCell);
            UpdateKeyboard(tvc, entryCell);
            UpdatePlaceholder(tvc, entryCell);
            UpdateLabelColor(tvc, entryCell);
            UpdateHorizontalTextAlignment(tvc, entryCell);
            UpdateIsEnabled(tvc, entryCell);

            return(tvc);
        }
Example #9
0
		static void UpdateIsEnabled(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.UserInteractionEnabled = entryCell.IsEnabled;
			cell.TextLabel.Enabled = entryCell.IsEnabled;
			cell.DetailTextLabel.Enabled = entryCell.IsEnabled;
			cell.TextField.Enabled = entryCell.IsEnabled;
		}
Example #10
0
		static void UpdateHorizontalTextAlignment(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.TextField.TextAlignment = entryCell.HorizontalTextAlignment.ToNativeTextAlignment();
		}
Example #11
0
 static void UpdateHorizontalTextAlignment(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextField.UpdateHorizontalTextAlignment(entryCell);
 }
Example #12
0
		static void UpdateText(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			if (cell.TextField.Text == entryCell.Text)
				return;
			// double sets side effect on iOS, YAY
			cell.TextField.Text = entryCell.Text;
		}
 private static void UpdateText(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     if (cell.TextField.Text == entryCell.Text)
     {
         return;
     }
     cell.TextField.Text = entryCell.Text;
 }
 private static void UpdateXAlign(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextField.TextAlignment = entryCell.XAlign.ToUITextAlignment();
 }
Example #15
0
		static void UpdatePlaceholder(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.TextField.Placeholder = entryCell.Placeholder;
		}
 static void UpdateHorizontalTextAlignment(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextField.TextAlignment = entryCell.HorizontalTextAlignment.ToNativeTextAlignment();
 }
Example #17
0
 static void UpdateLabelColor(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextLabel.TextColor = entryCell.LabelColor?.ToPlatform() ?? DefaultTextColor.ToPlatform();
 }
Example #18
0
 static void UpdateKeyboard(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextField.ApplyKeyboard(entryCell.Keyboard);
 }
 static void UpdateLabelColor(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextLabel.TextColor = entryCell.LabelColor.ToUIColor(DefaultTextColor);
 }
        static void UpdateHorizontalTextAlignment(EntryCellTableViewCell cell, EntryCell entryCell)
        {
            IViewController viewController = entryCell.Parent as View;

            cell.TextField.TextAlignment = entryCell.HorizontalTextAlignment.ToNativeTextAlignment(viewController?.EffectiveFlowDirection ?? default(EffectiveFlowDirection));
        }
Example #21
0
 static void UpdateLabel(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextLabel.Text = entryCell.Label;
 }
Example #22
0
		static void UpdateKeyboard(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.TextField.ApplyKeyboard(entryCell.Keyboard);
		}
Example #23
0
 static void UpdatePlaceholder(EntryCellTableViewCell cell, EntryCell entryCell)
 {
     cell.TextField.Placeholder = entryCell.Placeholder;
 }
Example #24
0
		static void UpdateLabel(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.TextLabel.Text = entryCell.Label;
		}
Example #25
0
		static void UpdateLabelColor(EntryCellTableViewCell cell, EntryCell entryCell)
		{
			cell.TextLabel.TextColor = entryCell.LabelColor.ToUIColor(DefaultTextColor);
		}
        private static void OnTextFieldTextChanged(object sender, EventArgs eventArgs)
        {
            EntryCellTableViewCell text = (EntryCellTableViewCell)sender;

            ((EntryCell)text.Cell).Text = text.TextField.Text;
        }