Example #1
0
 public Help()
 {
     InitializeComponent();
     this.toggleSwitch.Checked   += new EventHandler <RoutedEventArgs>(toggle_Checked);
     this.toggleSwitch.Unchecked += new EventHandler <RoutedEventArgs>(toggle_Unchecked);
     _app = Application.Current as HinduCalendarPhone.App;
     this.toggleSwitch.IsChecked = _app.Calendar.UseLocation;
 }
Example #2
0
 public Help()
 {
     InitializeComponent();
     this.toggleSwitch.Checked += new EventHandler<RoutedEventArgs>(toggle_Checked);
     this.toggleSwitch.Unchecked += new EventHandler<RoutedEventArgs>(toggle_Unchecked);
     _app = Application.Current as HinduCalendarPhone.App;
     this.toggleSwitch.IsChecked = _app.Calendar.UseLocation;
 }
        public void ShowDetail()
        {
            HinduCalendarPhone.App app = Application.Current as HinduCalendarPhone.App;
            EventDate.Value = app.CurrentDate;
            PageTitle.Text  = app.Calendar.CityName;
            PanchangData pdata = app.Calendar.GetPanchangDataForDay(app.CurrentDate.Year, app.CurrentDate.Month, app.CurrentDate.Day);

            DateTextBlock.Text        = app.CurrentDate.ToString("d");
            SunriseTextBlock.Text     = pdata._fieldValues[(int)FieldType.Sunrise];
            SunsetTextBlock.Text      = pdata._fieldValues[(int)FieldType.Sunset];
            MoonRiseTextBlock.Text    = pdata._fieldValues[(int)FieldType.Moonrise];
            TamilYearTextBlock.Text   = pdata._fieldValues[(int)FieldType.TamilYear];
            NorthYearTextBlock.Text   = pdata._fieldValues[(int)FieldType.NorthYear];
            GujaratYearTextBlock.Text = pdata._fieldValues[(int)FieldType.GujaratYear];
            AyanaTextBlock.Text       = pdata._fieldValues[(int)FieldType.Ayana];
            RituTextBlock.Text        = pdata._fieldValues[(int)FieldType.Ritu];
            VedicRituTextBlock.Text   = pdata._fieldValues[(int)FieldType.VedicRitu];
            TamilMonthTextBlock.Text  = pdata._fieldValues[(int)FieldType.TamilMonth];
            // there is a whitespace in front of this string
            SanskritMonthTextBlock.Text = (pdata._fieldValues[(int)FieldType.SanskritMonth]).Trim();
            PakshaTextBlock.Text        = (pdata._fieldValues[(int)FieldType.Paksha]).Trim();
            TithiTextBlock.Text         = pdata._fieldValues[(int)FieldType.Tithi];
            NakshatraTextBlock.Text     = pdata._fieldValues[(int)FieldType.Nakshatra];
            YogaTextBlock.Text          = pdata._fieldValues[(int)FieldType.Yoga];
            KaranaTextBlock.Text        = pdata._fieldValues[(int)FieldType.Karana];
            SunRasiTextBlock.Text       = pdata._fieldValues[(int)FieldType.SunRasi];
            MoonRasiTextBlock.Text      = pdata._fieldValues[(int)FieldType.MoonRasi];
            RahuKalamTextBlock.Text     = pdata._fieldValues[(int)FieldType.RahuKalam];
            YamaKandamTextBlock.Text    = pdata._fieldValues[(int)FieldType.YamaGandam];
            GulikaiTextBlock.Text       = pdata._fieldValues[(int)FieldType.Gulikai];
            String festival;

            if (app.CurrentDate.Year == 2013)
            {
                festival = Calender2.Data.FestivalDataGetter.GetFestivalData(app.CurrentDate.Year, app.CurrentDate.Month, app.CurrentDate.Day, app.Calendar.CityTimeZone);
            }
            else
            {
                festival = pdata._fieldValues[(int)FieldType.Festival];
            }

            if (String.IsNullOrEmpty(festival))
            {
                festival = "No festival";
            }
            FestivalTextBlock.Text = festival;
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string dateString = "";

            _currentDayView = this;
            HinduCalendarPhone.App app = Application.Current as HinduCalendarPhone.App;

            if (NavigationContext.QueryString.TryGetValue("date", out dateString))
            {
                Debug.WriteLine("Date to be shown is " + dateString);
                PageTitle.Text  = dateString;
                app.CurrentDate = DateTime.Parse(dateString);
            }
            ShowDetail();
        }
 private void EventDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     HinduCalendarPhone.App app = Application.Current as HinduCalendarPhone.App;
     if (e.NewDateTime.HasValue)
     {
         DateTime dt = e.NewDateTime.Value;
         if ((dt.Year >= 2013) && (dt.Year <= 2014))
         {
             app.CurrentDate = e.NewDateTime.Value;
         }
         else
         {
             MessageBox.Show("Year should be either 2013 or 2014");
             EventDate.Value = DateTime.Today;
         }
     }
 }