private void CalendarListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { using (MonthDiarys form = new MonthDiarys()) { form.LoadDiarys(new DateTime(_year, _month, _day)); form.ShowDialog(); } DisplayCalendar(_year, _month, _day); }
public CalendarWindow() { try { ConnectionOption.ConnectionString = SQLiteHelper.ConnectionString; InitializeComponent(); this.Loaded += WindowOnLoad; this.CalendarListBox.SelectionChanged += SelectedDateOnDisplay; this.Background = Brushes.Black; this.ResizeMode = ResizeMode.CanMinimize; this.text7.Foreground = Brushes.White; this.text8.Foreground = Brushes.Cyan; this.txtHolidayTips.Foreground = Brushes.White; this.txtAnimalYear.Foreground = Brushes.LightGray; this.txtHoroscope.Foreground = Brushes.LightGray; this.CalendarListBox.Foreground = Brushes.White; this.CalendarListBox.Background = Brushes.Black; this.CalendarListBox.Padding = new Thickness(0, 0, 0, 0); _year = DateTime.Now.Year; _month = DateTime.Now.Month; _day = DateTime.Now.Day; WeekdayLabelsConfigure(); SubscribeNavigationButtonEvents(); InitializTrayIcon(); this.Top = SystemParameters.WorkArea.Height - this.Height; this.Left = SystemParameters.WorkArea.Width - this.Width; //this.Top = SWF.Screen.PrimaryScreen.WorkingArea.Height - this.Height; //this.Left = SWF.Screen.PrimaryScreen.WorkingArea.Width - this.Width; MonthDiarys.StartRemindJobs(DateTime.Now, out ObservableCollection <Diary> diaries); } catch (Exception ex) { Debug.WriteLine("Error: except exec. \n{0}", ex.Message); return; } finally { Debug.WriteLine("final exec."); } }