Не прямой ответ на ваш вопрос ...
Но кто-то перенес отдельный ViewPager на MonoDroid: https://github.com/Cheesebaron/MonoDroid.HorizontalPager
А потом я добавил простой индикатор страницы, основанный на http://buildmobile.com/how-to-build-an-android-pager-component/#fbid=TnZmgHdBfhF
// original credit to:
// https://github.com/brucejcooper/Android-Examples/blob/master/PagingScrollerExample/src/com/eightbitcloud/pagingscroller/PageIndicator.java
public class HorizontalPagerIndicator : View
{
private HorizontalPager _pager;
private Paint _textPaint;
private Paint _inactiveDotPaint;
private Paint _dotPaint;
private Paint _dotBackgroundPaint;
private int _textHeight;
private int _ascent;
private int _cellSize;
private float _displayDensity;
public HorizontalPagerIndicator(Context context, IAttributeSet attrs)
: base(context, attrs)
{
InitPaints(context);
}
public HorizontalPagerIndicator(Context context)
: base(context)
{
InitPaints(context);
}
private void InitPaints(Context context)
{
_displayDensity = context.Resources.DisplayMetrics.Density;
_textPaint = new Paint {AntiAlias = true, TextSize = DeviceIndependentToPixels(14), Color = Color.Black};
_inactiveDotPaint = new Paint { AntiAlias = true, Color = Color.Gray };
_dotPaint = new Paint {AntiAlias = true, Color = Color.White};
_dotBackgroundPaint = new Paint { AntiAlias = true, Color = Color.Cyan };
_ascent = -(int)_textPaint.Ascent();
_textHeight = (int)(_ascent + _textPaint.Descent());
_cellSize = DeviceIndependentToPixels(_textHeight + 6);
}
public HorizontalPager Pager
{
get { return _pager; }
set {
if (_pager != null)
{
_pager.ScreenChanged -= PagerOnScreenChanged;
}
_pager = value;
if (_pager != null)
{
_pager.ScreenChanged += PagerOnScreenChanged;
}
UpdatePageCount();
}
}
private void PagerOnScreenChanged(object sender, EventArgs eventArgs)
{
Invalidate();
}
public void UpdatePageCount()
{
RequestLayout();
Invalidate();
}
private int NumPages
{
get
{
return _pager == null ? 1 : _pager.ChildCount;
}
}
private int ActivePage
{
get
{
return _pager == null ? 0 : _pager.CurrentScreen;
}
}
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
SetMeasuredDimension(MeasureWidth(widthMeasureSpec), MeasureHeight(heightMeasureSpec));
}
private int MeasureWidth(int measureSpec)
{
var result = 0;
var specMode = MeasureSpec.GetMode(measureSpec);
var specSize = MeasureSpec.GetSize(measureSpec);
if (specMode == MeasureSpecMode.Exactly)
{
// We were told how big to be
result = specSize;
}
else
{
result = NumPages * _cellSize;
if (specMode == MeasureSpecMode.AtMost)
{
// Respect AT_MOST value if that was what is called for by
// measureSpec
result = Math.Min(result, specSize);
}
}
return result;
}
private int MeasureHeight(int measureSpec)
{
var result = 0;
var specMode = MeasureSpec.GetMode(measureSpec);
var specSize = MeasureSpec.GetSize(measureSpec);
if (specMode == MeasureSpecMode.Exactly)
{
// We were told how big to be
result = specSize;
}
else
{
result = _cellSize;
if (specMode == MeasureSpecMode.AtMost)
{
// Respect AT_MOST value if that was what is called for by
// measureSpec
result = Math.Min(result, specSize);
}
}
return result;
}
protected override void OnDraw(Canvas canvas)
{
base.OnDraw(canvas);
var numPages = NumPages;
var activePageIndex = ActivePage;
var x = (canvas.Width - numPages * _cellSize)/2;
//var smallBorder = _cellSize/4;
//var slightlySmallerBorder = smallBorder - 1;
var emptyDotSize = _cellSize/4;
var dotOffset = (_cellSize - emptyDotSize) / 2;
for (var i = 0; i < numPages; i++, x += _cellSize)
{
if (i == activePageIndex)
{
//var txt = (i + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture);
//var bounds = new Rect();
//_textPaint.GetTextBounds(txt, 0, txt.Length, bounds);
//var oval = new RectF(x + smallBorder, smallBorder, x + _cellSize - smallBorder, _cellSize - smallBorder);
var oval = new RectF(x + dotOffset, dotOffset, x + dotOffset + emptyDotSize, dotOffset + emptyDotSize);
var oval1 = new RectF(x + dotOffset - 1, dotOffset - 1, x + dotOffset + emptyDotSize + 1, dotOffset + emptyDotSize + 1);
canvas.DrawOval(oval1, _dotBackgroundPaint);
canvas.DrawOval(oval, _dotPaint);
//canvas.DrawText(txt, x + (_cellSize - bounds.Width()) / 2, (_cellSize - _textHeight) / 2 + _ascent, _textPaint);
}
else
{
var oval = new RectF(x + dotOffset, dotOffset, x + dotOffset + emptyDotSize, dotOffset + emptyDotSize);
canvas.DrawOval(oval, _inactiveDotPaint);
}
}
}
private int DeviceIndependentToPixels(int dpi)
{
return (int)Math.Round((float)dpi * _displayDensity);
}
}
Однажды я получу пример проекта в GitHub!