26
loading...
This website collects cookies to deliver better user experience
xmlns:scheduler="using:Syncfusion.UI.Xaml.Scheduler"
<scheduler:SfScheduler x:Name="scheduler"
CalendarIdentifier="HijriCalendar" >
</scheduler:SfScheduler>
<scheduler:SfScheduler x:Name="scheduler"
CalendarIdentifier="HijriCalendar"
ViewType="Week">
</scheduler:SfScheduler>
<scheduler:SfScheduler x:Name="scheduler"
FirstDayOfWeek="Thursday"
CalendarIdentifier="HijriCalendar"
ViewType="Week">
</scheduler:SfScheduler>
// Creating an instance for the schedule appointment collection.
var appointments = new ScheduleAppointmentCollection();
// Adding schedule appointment in the schedule appointment collection.
appointments.Add(new ScheduleAppointment()
{
Subject = "Meeting",
// StartTime and EndTime values specified with calendar type and calendar date.
StartTime = new DateTime (1443, 02, 22, 10, 0, 0, new HijriCalendar()),
EndTime = new DateTime(1443, 02, 22, 11, 0, 0, new HijriCalendar()),
});
// Adding the schedule appointment collection to the ItemsSource.
this.scheduler.ItemsSource = appointments;
// Creating an instance for the schedule appointment collection.
var appointments = new ScheduleAppointmentCollection();
// Adding schedule appointment in the schedule appointment collection.
appointments.Add(new ScheduleAppointment()
{
Subject = "Meeting",
// StartTime and EndTime values specified with local system date will be converted to the Hijiri calendar.
StartTime = new DateTime(2021, 09, 29, 10, 0, 0, 0),
EndTime = new DateTime(2021, 09, 29, 11, 0, 0, 0),
});
// Adding the schedule appointment collection to the ItemsSource.
this.scheduler.ItemsSource = appointments;
// Adding schedule resource in the scheduler resource collection.
var ResourceCollection = new ObservableCollection<SchedulerResource>()
{
new SchedulerResource() { Name = "Sophia", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush((Color.FromArgb(255, 157, 101, 201))), Id = "1000" },
new SchedulerResource() { Name = "Zoey Addison", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush(Color.FromArgb(255, 240, 138, 93)), Id = "1001" },
new SchedulerResource() { Name = "James William", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush(Color.FromArgb(255,103, 155, 155)), Id = "1002" },
};
// Adding the scheduler resource collection to the schedule resources of SfScheduler.
this.scheduler.ResourceCollection = ResourceCollection;
// Creating an instance for the schedule appointment collection.
var scheduleAppointmentCollection = new ScheduleAppointmentCollection();
//Adding schedule appointment in the schedule appointment collection.
var appointment = new ScheduleAppointment()
{
// StartTime and EndTime values specified with local system date will be converted to the Hijiri calendar.
StartTime = new DateTime(2021, 09, 29, 10, 0, 0),
EndTime = new DateTime(2021, 09, 29, 11, 0, 0),
Subject = "General Meeting",
//Add Scheduler Resource Id to the schedule appointment.
ResourceIdCollection = new ObservableCollection<object>() { "1000", "1001" }
};
//Adding the schedule appointment to the schedule appointment collection.
scheduleAppointmentCollection.Add(appointment);
//Adding the schedule appointment collection to the ItemsSource of SfScheduler.
this.scheduler.ItemsSource = scheduleAppointmentCollection;
// DateTime value specified with calendar type and calendar date.
this.scheduler.MinimumDate = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
this.scheduler.MaximumDate = new DateTime(1443, 05, 22, 11, 0, 0, new HijriCalendar());
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.MinimumDate = new DateTime(2021, 02, 22, 10, 0, 0);
this.scheduler.MaximumDate = new DateTime(2021, 05, 22, 11, 0, 0);
// DateTime value specified with calendar type and calendar date.
this.scheduler.DisplayDate= new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.DisplayDate= new DateTime(2021, 09, 29, 10, 0, 0);
// DateTime value specified with calendar type and calendar date.
this.scheduler.SelectedDate = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.SelectedDate = new DateTime(2021, 09, 29, 10, 0, 0);
this.scheduler.DaysViewSettings.SpecialTimeRegions.Add(new SpecialTimeRegion
{
// StartTime and EndTime value specified with calendar type and calendar date.
StartTime = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar()),
EndTime = new DateTime(1443, 02, 22, 11, 0, 0, new HijriCalendar()),
CanEdit = true,
Background = new SolidColorBrush(Colors.LightGray),
Foreground = new SolidColorBrush(Colors.White),
});
this.scheduler.DaysViewSettings.SpecialTimeRegions.Add(new SpecialTimeRegion
{
// StartTime and EndTime value specified with local system date will be converted to the Hijiri calendar.
StartTime = new System.DateTime(2021, 09, 29, 13, 0, 0),
EndTime = new System.DateTime(2021, 09, 29, 14, 0, 0),
CanEdit = false,
Background = new SolidColorBrush(Colors.LightGray),
Foreground = new SolidColorBrush(Colors.White),
});
this.scheduler.BlackoutDates = GetBlackoutDates();
/// <summary>
/// Method to get blackout date collections.
/// </summary>
// <returns>The blackoutDateCollection.</returns>
private ObservableCollection<DateTime> GetBlackoutDates()
{
var blackoutDateCollection = new ObservableCollection<DateTime>()
{
// DateTime value specified with calendar type and calendar date.
new DateTime(1443, 02, 20, 10, 0, 0, new HijriCalendar()),
new DateTime(1443, 02, 21, 10, 0, 0, new HijriCalendar()),
new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar()),
new DateTime(1443, 02, 23, 10, 0, 0, new HijriCalendar()),
new DateTime(1443, 02, 24, 10, 0, 0, new HijriCalendar()),
};
return blackoutDateCollection;
}
this.scheduler.BlackoutDates = GetBlackoutDates();
/// <summary>
/// Method to get blackout date collections.
/// </summary>
// <returns>The blackoutDateCollection.</returns>
private ObservableCollection<DateTime> GetBlackoutDates()
{
var blackoutDateCollection = new ObservableCollection<DateTime>()
{
// DateTime value specified with local system date will be converted to the Hijiri calendar.
new DateTime(2021, 09, 27, 10, 0, 0),
new DateTime(2021, 09, 28, 10, 0, 0),
new DateTime(2021, 09, 29, 10, 0, 0),
new DateTime(2021, 09, 30, 10, 0, 0),
};
return blackoutDateCollection;
}
<scheduler:SfScheduler x:Name="scheduler"
Language="ar"
CalendarIdentifier="HijriCalendar"
ViewType="Week">
</scheduler:SfScheduler>