using Android.Content;
|
using Android.Runtime;
|
using Android.Util;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using Android.Views;
|
|
namespace Shared
|
{
|
/// <summary>
|
/// 日期视图
|
/// </summary>
|
public class DateView : View
|
{
|
/// <summary>
|
/// 当前视图
|
/// </summary>
|
/// <value>The android text.</value>
|
AndroidDatePicker currentAndroidDatePicker
|
{
|
get
|
{
|
return AndroidView as AndroidDatePicker;
|
}
|
set
|
{
|
AndroidView = value;
|
}
|
}
|
|
|
/// <summary>
|
/// 年
|
/// </summary>
|
public int Year
|
{
|
get { return currentAndroidDatePicker.Year; }
|
}
|
/// <summary>
|
/// 月
|
/// </summary>
|
public int Month
|
{
|
get { return currentAndroidDatePicker.Month; }
|
}
|
/// <summary>
|
/// 天
|
/// </summary>
|
public int Day
|
{
|
get { return currentAndroidDatePicker.DayOfMonth; }
|
}
|
|
/// <summary>
|
/// 实例
|
/// </summary>
|
public DateView()
|
{
|
currentAndroidDatePicker = new AndroidDatePicker(Application.Activity);
|
}
|
|
/// <summary>
|
/// Android 原生 AndroidDatePicker
|
/// </summary>
|
class AndroidDatePicker : Android.Widget.DatePicker
|
{
|
public AndroidDatePicker(Context context)
|
: base(context)
|
{ }
|
}
|
}
|
}
|