public View SetViewState(View _view, UIDay uIDay) { Frame view = null; if (_view != null && uIDay != null) { view = (Frame)_view; if (view == null) { return(_view); } if (uIDay.selectionStatus == SelectionStatus.Selected) { view.BorderColor = Color.FromHex("#EF4736"); } else if (uIDay.selectionStatus == SelectionStatus.Today) { view.BorderColor = Color.FromHex("#EF4736"); } else if (uIDay.selectionStatus == SelectionStatus.NotSlected) { view.BorderColor = Color.FromHex("#989da0"); } } return(view); }
public void LoadGUI() { int i = 0; foreach (UIElement UIE in this.UIDays.Children) { if (UIE is UIDay) { UIDay UIday = UIE as UIDay; UIday.Date = this.firstDateOfMonth.AddDays(i++); if (UIday.Date.Month != this._date.Month) { UIday.Mode = ModeDay.Disable; } else { UIday.Mode = ModeDay.Enable; } if (UIday.Date.Date == this.curDate.Date) { UIday.isCurDay = true; } else { UIday.isCurDay = false; } } } }
private List <UIDay> inputDate() { DateTime now = FirstDayOfWeek(DateTime.Now).AddDays(1); List <UIDay> uIDays = new List <UIDay>(); for (int i = 0; i < 7; i++) { UIDay uIDay = new UIDay(); uIDay.day = now.ToString("ddd").Substring(0, 2).ToLower(); uIDay.dateTime = now; // uIDay.selectionStatus = uIDays.Count % 2 == 0 ? SelectionStatus.NotSlected : SelectionStatus.Selected; uIDays.Add(uIDay); now = now.AddDays(1); } return(uIDays); }
public Label SetLabelState(Label label, UIDay uIDay) { if (label != null && uIDay != null) { if (uIDay.selectionStatus == SelectionStatus.Selected) { label.TextColor = Color.Black; } else if (uIDay.selectionStatus == SelectionStatus.Today) { label.TextColor = Color.FromHex("#EF4736"); } else if (uIDay.selectionStatus == SelectionStatus.NotSlected) { label.TextColor = Color.Black; label.Opacity = 0.5; } } return(label); }
private void Day_SelectDateEvent(object sender, DateTime e) { UIDay tmp = sender as UIDay; foreach (UIElement UIE in this.UIDays.Children) { if (UIE is UIDay) { UIDay day = UIE as UIDay; if (day.isCurDay) { day.isCurDay = false; } } } tmp.isCurDay = true; this.UIDate.LostFocus += DatePicker_LostFocus; tmpDate = e.Date; DateTime time = tmpDate; time = time.setTime(this.UITime.Time); this.UIDate.Text = time.format("HH:mm:ss dd/MM/yyyy"); }