void Schedule_OnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs args) { string day_Name = args.date.ToString("dddd"); //if (args.isToday) //{ // args.monthViewCellStyle.TextColor = Color.FromHex("#EEC72B"); // args.monthViewCellStyle.BackgroundColor = Color.Black; //} //else if (args.isPreviousMonth) //{ // args.monthViewCellStyle.TextColor = Color.White; //} //else if (args.isNextMonth) //{ // args.monthViewCellStyle.TextColor = Color.White; //} //else if (args.isCurrentMonth) //{ // args.monthViewCellStyle.TextColor = Color.Black; //} //if (((day_Name == "Saturday") || (day_Name == "Sunday")) && args.isCurrentMonth) //{ // args.monthViewCellStyle.TextColor = Color.FromHex("#EEC72B"); //} }
private void Schedule_MonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { NSDate date = e.Date; NSDateFormatter dateFormat = new NSDateFormatter(); dateFormat.DateFormat = "EEEE"; string monthName = dateFormat.ToString(date); if (e.IsToday) { e.CellStyle.TextColor = UIColor.FromRGB(238, 199, 43); } if ((monthName == "Sunday") || (monthName == "Saturday")) { e.CellStyle.TextColor = UIColor.Red; } if (e.IsPreviousMonthDate) { e.CellStyle.TextColor = UIColor.White; } if (e.IsNextMonthDate) { e.CellStyle.TextColor = UIColor.White; } }
private void CellLoaded(object sender, MonthCellLoadedEventArgs e) { if (e.Date == DateTime.Now.Date) { e.BackgroundColor = Color.Transparent; } }
private void SfSchedule_MonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { Calendar calendar = e.Calendar; FrameLayout frameLayout = new FrameLayout(mContext); if (calendar != null) { GradientDrawable gradientDrawable = new GradientDrawable( GradientDrawable.Orientation.TopBottom, new int[] { 255, 0 }); //0xFF616261 gradientDrawable.SetCornerRadius(0f); TextView monthCellText = new TextView(mContext); String text = new SimpleDateFormat("dd").Format(calendar.Time); monthCellText.Text = (text); if ((calendar.Get(CalendarField.DayOfWeek) == Calendar.Sunday) || (calendar.Get(CalendarField.DayOfWeek) == Calendar.Saturday)) { monthCellText.SetTextColor(Color.Red); } else { monthCellText.SetTextColor(Color.Black); } if ((calendar.Get(CalendarField.Year) == Calendar.Instance.Get(CalendarField.Year)) && (calendar.Get(CalendarField.Month) == Calendar.Instance.Get(CalendarField.Month) && (calendar.Get(CalendarField.DayOfMonth) == Calendar.Instance.Get(CalendarField.DayOfMonth)))) { monthCellText.SetTextColor(Color.LightBlue); } monthCellText.TextSize = (18); monthCellText.Gravity = GravityFlags.CenterHorizontal; monthCellText.SetPadding(0, 10, 0, 0); LinearLayout layout = new LinearLayout(mContext); Button appDot = new Button(mContext); LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); params1.SetMargins(0, 80, 0, 0); appDot.LayoutParameters = (params1); GradientDrawable appDotDrawable = new GradientDrawable(); appDotDrawable.SetColor(255); appDotDrawable.SetCornerRadius(15); appDotDrawable.SetStroke(0, Color.Red); layout.SetGravity(GravityFlags.CenterHorizontal); appDot.Background = (appDotDrawable); appDot.LayoutParameters = (new ViewGroup.LayoutParams(10, 10)); layout.Orientation = Orientation.Vertical; View line = new View(mContext); line.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 1)); line.SetBackgroundColor(Color.Gray); layout.AddView(line); layout.AddView(monthCellText); if (e.Appointments != null && e.Appointments.Count > 0) { layout.AddView(appDot); } frameLayout.AddView(layout); } e.View = frameLayout; }
private void calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { List <DateTime> blackoutDates = new List <DateTime>(); if (!viewModel.DatasSelecionadas.Contains(e.Date)) { blackoutDates.Add(e.Date); calendar.BlackoutDates = blackoutDates; } }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { var model = new ViewModel(); model.DayNumber = e.Date.Day.ToString(); if (Convert.ToDateTime(calendar.SelectedDate).Day == e.Date.Day && Convert.ToDateTime(calendar.SelectedDate).Month == e.Date.Month && Convert.ToDateTime(calendar.SelectedDate).Year == e.Date.Year) { model.IsSelected = true; } e.CellBindingContext = model; }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { var blackoutDates = new ObservableCollection <DateTime>(); if (e.Date.DayOfWeek == DayOfWeek.Sunday || e.Date.DayOfWeek == DayOfWeek.Saturday) { if (this.calendar.BlackoutDates != null) { blackoutDates = (ObservableCollection <DateTime>) this.calendar.BlackoutDates; } blackoutDates.Add(e.Date); this.calendar.BlackoutDates = blackoutDates; } }
void SfSchedule_OnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs e) { Grid mainLayout = new Grid(); mainLayout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); mainLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); Label dateLabel = new Label(); dateLabel.Text = e.date.ToString("dd"); dateLabel.HorizontalTextAlignment = TextAlignment.Center; dateLabel.VerticalOptions = LayoutOptions.FillAndExpand; dateLabel.HorizontalOptions = LayoutOptions.FillAndExpand; dateLabel.BackgroundColor = Color.Transparent; mainLayout.Children.Add(dateLabel); ListView listView = new ListView(); listView.HasUnevenRows = false; listView.BackgroundColor = Color.Transparent; listView.RowHeight = 20; var appointmentTemplate = new DataTemplate(() => { var grid = new Grid(); var appointmentName = new Label { Margin = new Thickness(0, 3, 3, 0), FontSize = 14 }; var collection = (e.appointments as ObservableCollection <object>); appointmentName.SetBinding(Label.TextProperty, "Event"); appointmentName.SetBinding(Label.BackgroundColorProperty, "Color"); grid.Children.Add(appointmentName); return(new ViewCell { View = grid }); }); listView.ItemTemplate = appointmentTemplate; listView.ItemsSource = e.appointments; if ((e.appointments as ObservableCollection <object>).Count != 0) { mainLayout.Children.Add(listView, 0, 1); } // Setting custom view for month cell e.view = mainLayout; }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { CalendarCustomizationViewModel viewModel = new CalendarCustomizationViewModel(e.IsCurrentMonth, e.Date); e.CellBindingContext = viewModel; }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { var dataTemplate = GetDayModelFor(e.Date, calendar); e.CellBindingContext = dataTemplate; }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { var viewModel = GetDayModelFor(e.Date, calendar); e.CellBindingContext = viewModel; }
public async void Handle_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs args) { var x = args.Date; await VM.ExecuteGetFacebookEventsCommand(x); }
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs e) { CalendarPageModel cellBindingContext = new CalendarPageModel(e.IsCurrentMonth, e.Date); e.CellBindingContext = cellBindingContext; }