Tengo un Acivity donde necesito utilizar dos DatePickerDialog, pare establecer un rango entre fechas, éste es el código que utilizo para poder crear el primer datepicker y obtener sus datos y obtener el rango inicial de la fecha requerida
private void BtnDel_Click(object sender, EventArgs e)
{
ShowDialog(DATE_DIALOG);
}
protected override Dialog OnCreateDialog(int id)
{
switch (id)
{
case DATE_DIALOG:
{
return new DatePickerDialog(this, this, year, month, day);
}
break;
case DATE_DIALOG2:
{
return new DatePickerDialog(this, this, anio, mes, dia);
}
break;
default:
break;
}
return null;
}
public void OnDateSet(DatePicker view, int year, int month, int dayOfMonth)
{
this.year = year;
this.month = month;
this.day = dayOfMonth;
Toast.MakeText(this, "Seleccionaste :" + (month + 1) + "/" + day + "/" + year, ToastLength.Short).Show();
string Del = (year + "-" + (month + 1) + "-" + day).ToString();
btnDel.Text = Del;
}
El problema que tengo, es que quiero poder tener dos métodos OnDatSet() y dos OnCreateDialog, porque tengo que usar un segundo datepickerdialog para establecer el rango final de la fecha. Pero esos métodos son creados por Xamarin Android, así que no puedo utilizarlos dos veces, y solamente sirven para 1 datepickerdialog, alguna solución?
Quiero que cada botón "Del" "Al" tenga una fecha diferente. un método OnDataSet, para cada datepickerdialog.