public override IConvertView GetItem(int index) { if (index < Items.Count) { IConvertView convertView = Items[index]; if (false == convertView.GetRectTransform().gameObject.activeSelf) { convertView.GetRectTransform().gameObject.SetActive(true); } return(Items[index]); } else { IConvertView convertView = Adapter.GetConvertView(index, null); var transform = convertView.GetRectTransform(); transform.SetParent(ContentTransform); transform.pivot = transform.anchorMin = transform.anchorMax = new Vector2(0, 1); switch (ScrollOrentation) { case ScrollOrentation.Horizontal: transform.sizeDelta = new Vector2(TableItemSize, Height); break; case ScrollOrentation.Vertical: transform.sizeDelta = new Vector2(Width, TableItemSize); break; } Items.Add(convertView); return(convertView); } }
/// <summary> /// команда конвертации курса /// </summary> /// <param name="_viewModel">представление курса</param> /// <exception cref="ArgumentNullException"></exception> public ConvertCommand(IConvertView _convertor) { if (_convertor == null) throw new ArgumentNullException(); convertor = _convertor; convertor.PropertyChanged += vm_PropertyChanged; }
/// <summary> /// команда конвертации курса /// </summary> /// <param name="_viewModel">представление курса</param> /// <exception cref="ArgumentNullException"></exception> public ConvertCommand(IConvertView _convertor) { if (_convertor == null) { throw new ArgumentNullException(); } convertor = _convertor; convertor.PropertyChanged += vm_PropertyChanged; }
public IConvertView GetConvertView(int position, IConvertView convertView) { BaseConvertView cell = convertView as BaseConvertView; if (cell == null) { cell = new BaseConvertView(); cell.Name = "Cell " + position; cell.FontSize = 25; cell.BackgroundColor = new Color(1, 1, 1, 0.5f); } cell.Title = "Items:" + position; return(cell); }
public IConvertView GetConvertView(int position, IConvertView convertView) { TypeListCell cell = convertView as TypeListCell; if (cell == null) { cell = new TypeListCell(); cell.FontSize = 25; cell.TextComponent.alignment = TextAnchor.MiddleCenter; UILayout.AddUnderLine(cell.GetRectTransform(), Screen.height / 720f, Color.white); } cell.Text = "Part" + (position + 1) + "." + Types[position]; return(cell); }
public IConvertView GetConvertView(int position, IConvertView convertView) { BaseConvertView cell = convertView as BaseConvertView; if (cell == null) { cell = new BaseConvertView(); cell.FontSize = 25; } cell.BackgroundColor = position % 2 == 0 ? Color.white : Color.black; cell.TitleColor = position % 2 == 0 ? Color.black : Color.white; cell.Title = "Item:" + position; return(cell); }
public IConvertView GetConvertView(int position, IConvertView convertView) { BaseConvertView cell = convertView as BaseConvertView; if (cell == null) { cell = new BaseConvertView(); cell.FontSize = 25; cell.TitleTextComponent.alignment = TextAnchor.MiddleCenter; } cell.Title = "Item:" + position; cell.BackgroundColor = RandomColor[position]; return(cell); }
public override IConvertView GetItem(int index) { if (index < Items.Count) { IConvertView convertView = Items[index]; if (false == convertView.GetRectTransform().gameObject.activeSelf) { convertView.GetRectTransform().gameObject.SetActive(true); } return(Items[index]); } else { IConvertView convertView = Adapter.GetConvertView(index, null); RectTransform transform = convertView.GetRectTransform(); transform.SetParent(ContentTransform); transform.pivot = transform.anchorMin = transform.anchorMax = new Vector2(0, 1); transform.sizeDelta = ItemSize; Items.Add(convertView); return(convertView); } }
public override IConvertView GetItem(int index) { if (index < Items.Count) { IConvertView convertView = Items[index]; var transform = convertView.GetRectTransform(); if (false == transform.gameObject.activeSelf) { transform.gameObject.SetActive(true); } transform.sizeDelta = new Vector2(Width, HeightCache[StartIndex + index]); return(convertView); } else { IConvertView convertView = Adapter.GetConvertView(index, null); var transform = convertView.GetRectTransform(); transform.SetParent(ContentTransform); transform.pivot = transform.anchorMin = transform.anchorMax = new Vector2(0, 1); transform.sizeDelta = new Vector2(Width, HeightCache[StartIndex + index]); Items.Add(convertView); return(convertView); } }