private UITableViewCell UITableViewCellSliderWithValueAndMinMaxFactory(UITableView tv)
{
UITableViewCell cell = tv.DequeueReusableCell(CellKey);
if (cell == null)
{
cell = new UITableViewCell(UITableViewCellStyle.Default, CellKey);
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
}
else
RemoveTag(cell, 1);
SizeF captionSize = new SizeF(0, 0);
UILabel labelMinValue = null;
UILabel labelMaxValue = null;
UILabel labelValue = null;
if (MinValue != null)
{
labelMinValue = new UILabel();
labelMinValue.Text = this.MinValue.ToString();
cell.ContentView.AddSubview(labelMinValue);
}
if (slider == null)
{
slider = new UISlider(new RectangleF(10f + captionSize.Width, 12f, 280f - captionSize.Width, 7f))
{
BackgroundColor = UIColor.Clear,
MinValue = this.MinValue,
MaxValue = this.MaxValue,
Continuous = true,
Value = this.Value,
Tag = 1
};
slider.ValueChanged += delegate
{
Value = slider.Value;
};
//cell.ContentView.AddSubview(slider);
}
else
{
slider.Value = Value;
}
if (MaxValue != null)
{
labelMaxValue = new UILabel();
labelMaxValue.Text = this.MaxValue.ToString();
cell.ContentView.AddSubview(labelMaxValue);
}
if (Value != null)
{
RectangleF rf = new RectangleF(200,0,20,20);
labelValue = new UILabel(rf);
labelValue.Text = this.Value.ToString();
cell.ContentView.AddSubview(labelValue);
}
return cell;
}