public override View GetSampleContent(Context context) { this.context = context; LinearLayout linearLayout = new LinearLayout(context); linearLayout.Orientation = Orientation.Vertical; //creating instance for Schedule sfSchedule = new SfSchedule(context); sfSchedule.ScheduleView = ScheduleView.WeekView; sfSchedule.AllowAppointmentDrag = true; sfSchedule.AppointmentDrop += SfSchedule_AppointmentDrop; NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock(); //Create new instance of NonAccessibleBlocksCollection NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); WeekViewSettings weekViewSettings = new WeekViewSettings(); nonAccessibleBlock.StartTime = 13; nonAccessibleBlock.EndTime = 14; nonAccessibleBlock.Text = "LUNCH"; nonAccessibleBlock.Color = Color.Black; nonAccessibleBlocksCollection.Add(nonAccessibleBlock); weekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; sfSchedule.WeekViewSettings = weekViewSettings; //set the appointment collection GetAppointments(); sfSchedule.ItemsSource = appointmentCollection; linearLayout.AddView(sfSchedule); return(linearLayout); }
public override View GetSampleContent(Context context) { con = context; sfschedule = new SfSchedule(context); InitializingAppointmentData(); sfschedule.ScheduleView = ScheduleView.DayView; sfschedule.TimeIntervalHeight = -1; sfschedule.VisibleDatesChanged += Sfschedule_VisibleDatesChanged; var dayViewSettings = new DayViewSettings(); dayViewSettings.StartHour = 9; dayViewSettings.EndHour = 16; sfschedule.DayViewSettings = dayViewSettings; nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); var lunch = new NonAccessibleBlock(); lunch.StartTime = 12; lunch.EndTime = 13; lunch.Text = "Lunch Break"; nonAccessibleBlocksCollection.Add(lunch); nonAccessibleBlocks = nonAccessibleBlocksCollection; sfschedule.DayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; LinearLayout layout = new LinearLayout(context); layout.Orientation = Android.Widget.Orientation.Vertical; layout.AddView(sfschedule); return(layout); }
private NonAccessibleBlocksCollection SetNonAccessibleBlocks() { NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); NonAccessibleBlock lunch = new NonAccessibleBlock(); lunch.StartTime = 13; lunch.EndTime = 14; lunch.Text = "Lunch Break"; nonAccessibleBlocksCollection.Add(lunch); nonAccessibleBlocks = nonAccessibleBlocksCollection; return(nonAccessibleBlocks); }
/// <summary> /// Initializes a new instance of the <see cref="TimetableViewModel" /> class. /// </summary> public TimetableViewModel() { this.Appointments = new ScheduleAppointmentCollection(); this.InitializingAppointmentData(); NonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); var lunch = new NonAccessibleBlock(); lunch.StartTime = 12; lunch.EndTime = 13; lunch.Text = "Lunch Break"; NonAccessibleBlocksCollection.Add(lunch); this.NonAccessibleBlocks = NonAccessibleBlocksCollection; }
/// <summary> /// method for non accessible blocks /// </summary> private void SetNonAccessibleBlocks() { if (Device.RuntimePlatform == "Android" || Device.RuntimePlatform == "iOS") { NonAccessibleBlocksCollection nonAccessibleBlocks = new NonAccessibleBlocksCollection(); var nonAccessibleBlock = new NonAccessibleBlock(); nonAccessibleBlock.StartTime = 13; nonAccessibleBlock.EndTime = 14; nonAccessibleBlock.Text = "Lunch time"; nonAccessibleBlocks.Add(nonAccessibleBlock); this.schedule.DayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; this.schedule.WeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; this.schedule.WorkWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks; } }
public SchedulesWeekPage() { InitializeComponent(); if (Device.OS != TargetPlatform.Android) { schedule.ScheduleView = ScheduleView.WorkWeekView; //Create new instance of NonAccessibleBlock NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock(); //Create new instance of NonAccessibleBlocksCollection NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); nonAccessibleBlock.StartTime = 11; nonAccessibleBlock.EndTime = 13; nonAccessibleBlock.Text = "ALMOÇO"; nonAccessibleBlock.Color = Color.DarkGreen; nonAccessibleBlocksCollection.Add(nonAccessibleBlock); schedule.WorkWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; } }
void NonAccessibleBlockSwitchToggled(object sender, ToggledEventArgs e) { if (e.Value) { // Non- accessible block NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); NonAccessibleBlock non_accessible_block = new NonAccessibleBlock(); non_accessible_block.StartTime = 13; non_accessible_block.EndTime = 14; non_accessible_block.Text = "Lunch Break"; nonAccessibleBlocksCollection.Add(non_accessible_block); Schedule.DayViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; Schedule.WeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; Schedule.WorkWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; } else { Schedule.DayViewSettings.NonAccessibleBlocks = new NonAccessibleBlocksCollection(); Schedule.WeekViewSettings.NonAccessibleBlocks = new NonAccessibleBlocksCollection(); Schedule.WorkWeekViewSettings.NonAccessibleBlocks = new NonAccessibleBlocksCollection(); } }
public Schedule() { InitializeComponent(); //schedule.ScheduleView = ScheduleView.WorkWeekView; ////Create new instance of WorkWeekViewSettings //WorkWeekViewSettings workWeekViewSettings = new WorkWeekViewSettings(); //workWeekViewSettings.TimeSlotBorderColor = Color.Aqua; //workWeekViewSettings.VerticalLineColor = Color.Blue; //workWeekViewSettings.TimeSlotColor = Color.Yellow; //workWeekViewSettings.TimeSlotBorderStrokeWidth = 5; //workWeekViewSettings.VerticalLineStrokeWidth = 5; //schedule.WorkWeekViewSettings = workWeekViewSettings; schedule.ScheduleView = ScheduleView.WorkWeekView; //Create new instance of NonAccessibleBlock NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock(); //Create new instance of NonAccessibleBlocksCollection NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection(); WorkWeekViewSettings workWeekViewSettings = new WorkWeekViewSettings(); nonAccessibleBlock.StartTime = 13; nonAccessibleBlock.EndTime = 14; nonAccessibleBlock.Text = "LUNCH"; nonAccessibleBlock.Color = Color.GreenYellow; nonAccessibleBlocksCollection.Add(nonAccessibleBlock); workWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection; //Create new instance of SelectionStyle SelectionStyle selectionStyle = new SelectionStyle(); selectionStyle.BackgroundColor = Color.Red; selectionStyle.BorderColor = Color.Black; selectionStyle.BorderThickness = 5; selectionStyle.BorderCornerRadius = 5; schedule.SelectionStyle = selectionStyle; }