c# - Windows phone calendar month view as datepicker -
is possible use calendar month view datepicker? make custom control?
you can create xaml page calender view , can pass selected date in parameters along previous xaml page landed on calender view page.
for example, have xaml page - mainpage.xaml button "select date". on tap/click event
of button use following code:
private void selectdate_tap(object sender, system.windows.input.gestureeventargs e) { navigationservice.navigate(new uri("/dateview.xaml", urikind.relative)); }
on dateview.xaml page place calender view , on calender item click event following:
private void calenderitem_tap(object sender, system.windows.input.gestureeventargs e) { var selecteddate = /*calender's selected item*/; var lastpage = navigationservice.backstack.firstordefault(); string pagename = lastpage.tostring(); navigationservice.navigate(new uri(pagename+"?date="+selecteddate, urikind.relative)); }
then again on mainpage.xaml following:
protected override void onnavigatedto(microsoft.phone.navigation.phonenavigationeventargs e) { base.onnavigatedto(e); string date = navigationcontext.querystring["date"]; }
Comments
Post a Comment