JOHN JOHNNNY

JOHN JOHNNNY

  • NA
  • 190
  • 140.8k

Binding text files to datepicker

Feb 4 2015 10:00 AM
Hi
 
I am using date picker in my app for users to navigate back and forth to any content of the day they missed for them to catch up on it
I have 365 text files in my folder for each day. The challenge am having is how to bind each 365 text files to each day of the year
 
This is my code below
 
xaml.cs
public partial class MainPage : PhoneApplicationPage
{
Appointments appointments = new Appointments();

// Constructor
public MainPage()
{
InitializeComponent();
 
appointments.SearchCompleted += new EventHandler(appointments_SearchCompleted);
SearchCalendar();
 
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
 
private void SearchCalendar()
{
appointments.SearchAsync(DateBox.Value.Value, DateBox.Value.Value.AddDays(1), null);
}
 
private void DateBox_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
{
SearchCalendar();
}
 
void appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
if (e.Results.Count() == 0)
{
MessageText.Text = "no events for the selected day";
}
else
{
MessageText.Text = e.Results.Count() + " events found";
DateList.ItemsSource = e.Results;
}
}