Skip to content

Commit 488eec8

Browse files
Merge pull request #3832 from syncfusion-content/997029-Scheduler-UG
997029 : Updated UG for new features in maui scheduler
2 parents 5d56d1d + 082cab6 commit 488eec8

11 files changed

+347
-2
lines changed
56.8 KB
Loading
36.7 KB
Loading
44.5 KB
Loading
82.8 KB
Loading
82.3 KB
Loading
92.6 KB
Loading
95.5 KB
Loading
26.3 KB
Loading

MAUI/Scheduler/month-view.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,62 @@ this.Scheduler.MonthView.AppointmentIndicatorSize = 10;
109109

110110
![change-appointment-indicator-size-in-maui-scheduler](images/month-view/appointment-indicator-size-maui-scheduler.png){:width="325" height="600" loading="lazy" .lazy .shadow-effect .section-padding .img-padding}
111111

112+
## Appointment indicator renderer mode
113+
114+
The scheduler month view allows you to customize the appointment indicator rendering mode by using the `AppointmentIndicatorRenderMode` property of the [MonthView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerMonthView.html). The `AppointmentIndicatorRenderMode` property supports three different types: `Fill`, `Stroke` and `FillAndStroke`. By default, the `AppointmentIndicatorRenderMode` is set to Fill.
115+
116+
{% tabs %}
117+
{% highlight XAML hl_lines="5" %}
118+
119+
<schedule:SfScheduler x:Name="Scheduler"
120+
View="Month" >
121+
<schedule:SfScheduler.MonthView>
122+
<schedule:SchedulerMonthView AppointmentDisplayMode="Indicator" AppointmentIndicatorSize="15" AppointmentIndicatorCount="2" AppointmentIndicatorRenderMode="Stroke"/>
123+
</schedule:SfScheduler.MonthView>
124+
</schedule:SfScheduler>
125+
126+
{% endhighlight %}
127+
{% highlight C# hl_lines="4" %}
128+
129+
this.Scheduler.View = SchedulerView.Month;
130+
this.Scheduler.MonthView.AppointmentDisplayMode = SchedulerMonthAppointmentDisplayMode.Indicator;
131+
this.Scheduler.MonthView.AppointmentIndicatorRenderMode = AppointmentIndicatorRenderMode.Stroke;
132+
this.Scheduler.MonthView.AppointmentIndicatorSize = 15;
133+
this.Scheduler.MonthView.AppointmentIndicatorCount = 2;
134+
135+
{% endhighlight %}
136+
{% endtabs %}
137+
138+
![appointment-renderer-mode-stroke-maui-scheduler](images/month-view/appointment-renderer-mode-stroke-maui-scheduler.png){:width="325" height="600" loading="lazy" .lazy .shadow-effect .section-padding .img-padding}
139+
140+
## Appointment indicator stroke thickness
141+
142+
The scheduler month view allows you to customize the appointment indicator stroke thickness by using the `AppointmentIndicatorStrokeThickness` property of the [MonthView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerMonthView.html). By default, the `AppointmentIndicatorStrokeThickness` is set to 1d.
143+
144+
{% tabs %}
145+
{% highlight XAML hl_lines="5" %}
146+
147+
<schedule:SfScheduler x:Name="Scheduler"
148+
View="Month" >
149+
<schedule:SfScheduler.MonthView>
150+
<schedule:SchedulerMonthView AppointmentDisplayMode="Indicator" AppointmentIndicatorSize="20" AppointmentIndicatorRenderMode="Stroke" AppointmentIndicatorStrokeThickness="4"/>
151+
</schedule:SfScheduler.MonthView>
152+
</schedule:SfScheduler>
153+
154+
{% endhighlight %}
155+
{% highlight C# hl_lines="6" %}
156+
157+
this.Scheduler.View = SchedulerView.Month;
158+
this.Scheduler.MonthView.AppointmentDisplayMode = SchedulerMonthAppointmentDisplayMode.Indicator;
159+
this.Scheduler.MonthView.AppointmentIndicatorRenderMode = AppointmentIndicatorRenderMode.Stroke;
160+
this.Scheduler.MonthView.AppointmentIndicatorSize = 20;
161+
this.Scheduler.MonthView.AppointmentIndicatorStrokeThickness = 4;
162+
163+
{% endhighlight %}
164+
{% endtabs %}
165+
166+
![appointment-indicator-stroke-thickness-maui-scheduler](images/month-view/appointment-indicator-stroke-thickness-maui-scheduler.png){:width="325" height="600" loading="lazy" .lazy .shadow-effect .section-padding .img-padding}
167+
112168
## Hide leading and trailing dates
113169

114170
The previous and next month dates from a Scheduler month view can be hidden by using the [ShowLeadingAndTrailingDates](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerMonthView.html#Syncfusion_Maui_Scheduler_SchedulerMonthView_ShowLeadingAndTrailingDates) property in the [MonthView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerMonthView.html). The `ShowLeadingAndTrailingDates` property defaults to `true.`

MAUI/Scheduler/resource-view.md

Lines changed: 259 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ this.Scheduler.AppointmentsSource = appointment;
114114

115115
![Resource sharing in .NET MAUI Scheduler.](images/resource-view/resource-view-sharing-in-net-maui-scheduler.png)
116116

117-
## Resource Grouping in Days View
117+
## Resource Grouping in Days View - Desktop
118118

119119
In the day, week, and work week views, you can control whether dates are grouped under resources or resources are grouped under dates by using the [`ResourceGroupType`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_ResourceGroupType) property of the [`SchedulerResourceView`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_Resources) class.
120120

@@ -172,6 +172,264 @@ this.Scheduler.ResourceView.ResourceGroupType = SchedulerResourceGroupType.Date;
172172

173173
![Resource Grouping By Date in Days View in .NET MAUI Scheduler.](images/resource-view/group-resources-by-date-in-days-view-in-net-maui-scheduler.png)
174174

175+
## Resource Grouping in Days View - Mobile
176+
177+
In Mobile platforms, the resource view for the day, week, and work week view where grouped under an adaptive header.
178+
179+
N> The adaptive header display of resources in the **Day**, **Week**, and **Work Week** views is supported only on .NET MAUI mobile platforms (**Android** and **iOS**).
180+
181+
### Customize hamburger icon color
182+
183+
The hamburger icon color can be customized by using the `HamburgerIconColor` property of the [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html?tabs=tabid-13%2Ctabid-6).
184+
185+
{% tabs %}
186+
{% highlight XAML hl_lines="4" %}
187+
188+
<syncfusion:SfScheduler x:Name="Scheduler" View="Day">
189+
<syncfusion:SfScheduler.ResourceView>
190+
<syncfusion:SchedulerResourceView HamburgerIconColor="Red" />
191+
</syncfusion:SfScheduler.ResourceView>
192+
</syncfusion:SfScheduler>
193+
194+
{% endhighlight %}
195+
{% highlight C# hl_lines="9" %}
196+
var Resources = new ObservableCollection<SchedulerResource>()
197+
{
198+
new SchedulerResource() { Name = "Sophia", Id = "1000" },
199+
new SchedulerResource() { Name = "Zoey Addison", Id = "1001" },
200+
new SchedulerResource() { Name = "James William", Id = "1002" },
201+
};
202+
203+
this.Scheduler.ResourceView.Resources = Resources;
204+
this.Scheduler.ResourceView.HamburgerIconColor = Colors.Red;
205+
206+
{% endhighlight %}
207+
{% endtabs %}
208+
209+
![customize-hamburger-icon-color-in-maui-scheduler](images/resource-view/customize-hamburger-icon-color-in-maui-scheduler.png)
210+
211+
### Customize drawer resource selection color
212+
213+
The drawer resource selection color can be customized by using the `DrawerResourceSelectionColor` property of the [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html?tabs=tabid-13%2Ctabid-6).
214+
215+
{% tabs %}
216+
{% highlight XAML hl_lines="4" %}
217+
218+
<syncfusion:SfScheduler x:Name="Scheduler" View="Day">
219+
<syncfusion:SfScheduler.ResourceView>
220+
<syncfusion:SchedulerResourceView DrawerResourceSelectionColor="DodgerBlue" />
221+
</syncfusion:SfScheduler.ResourceView>
222+
</syncfusion:SfScheduler>
223+
224+
{% endhighlight %}
225+
{% highlight C# hl_lines="9" %}
226+
var Resources = new ObservableCollection<SchedulerResource>()
227+
{
228+
new SchedulerResource() { Name = "Sophia", Id = "1000" },
229+
new SchedulerResource() { Name = "Zoey Addison", Id = "1001" },
230+
new SchedulerResource() { Name = "James William", Id = "1002" },
231+
};
232+
233+
this.Scheduler.ResourceView.Resources = Resources;
234+
this.Scheduler.ResourceView.DrawerResourceSelectionColor = Brush.DodgerBlue;
235+
236+
{% endhighlight %}
237+
{% endtabs %}
238+
239+
![customize-drawer-resource-selection-color-in-maui-scheduler](images/resource-view/customize-drawer-resource-selection-color-in-maui-scheduler.png)
240+
241+
### Customize drawer background
242+
243+
The drawer background can be customized by using the `DrawerBackground` property of the [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html?tabs=tabid-13%2Ctabid-6).
244+
245+
{% tabs %}
246+
{% highlight XAML hl_lines="4" %}
247+
248+
<syncfusion:SfScheduler x:Name="Scheduler" View="Day">
249+
<syncfusion:SfScheduler.ResourceView>
250+
<syncfusion:SchedulerResourceView DrawerBackground="LightGoldenrodYellow" />
251+
</syncfusion:SfScheduler.ResourceView>
252+
</syncfusion:SfScheduler>
253+
254+
{% endhighlight %}
255+
{% highlight C# hl_lines="9" %}
256+
var Resources = new ObservableCollection<SchedulerResource>()
257+
{
258+
new SchedulerResource() { Name = "Sophia", Id = "1000" },
259+
new SchedulerResource() { Name = "Zoey Addison", Id = "1001" },
260+
new SchedulerResource() { Name = "James William", Id = "1002" },
261+
};
262+
263+
this.Scheduler.ResourceView.Resources = Resources;
264+
this.Scheduler.ResourceView.DrawerBackground = Brush.LightGoldenrodYellow;
265+
266+
{% endhighlight %}
267+
{% endtabs %}
268+
269+
![customize-drawer-background-in-maui-scheduler](images/resource-view/customize-drawer-background-in-maui-scheduler.png)
270+
271+
### Customize adaptive header appearance using DataTemplate
272+
273+
The adaptive header appearance customization can be achieved by using the `AdaptiveHeaderTemplate` property of [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html?tabs=tabid-13%2Ctabid-6) in the [SfScheduler](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SfScheduler.html).
274+
275+
{% tabs %}
276+
{% highlight xaml tabtitle="MainPage.xaml" %}
277+
278+
<schedule:SfScheduler x:Name="Scheduler" View="Day">
279+
<schedule:SfScheduler.ResourceView>
280+
<schedule:SchedulerResourceView>
281+
<schedule:SchedulerResourceView.AdaptiveHeaderTemplate>
282+
<DataTemplate>
283+
<Grid Padding="8" BackgroundColor="PaleGreen">
284+
<HorizontalStackLayout Spacing="8" VerticalOptions="Center">
285+
<Label Text="☰"
286+
FontSize="16"
287+
VerticalTextAlignment="Center"
288+
HorizontalTextAlignment="Center"
289+
TextColor="Red"
290+
Margin="0,0,12,0">
291+
<Label.GestureRecognizers>
292+
<TapGestureRecognizer Tapped="OnTapped" />
293+
</Label.GestureRecognizers>
294+
</Label>
295+
<Label Text="{Binding Resource.Name}"
296+
FontAttributes="Bold"
297+
FontSize="14"
298+
TextColor="DarkViolet" />
299+
</HorizontalStackLayout>
300+
</Grid>
301+
</DataTemplate>
302+
</schedule:SchedulerResourceView.AdaptiveHeaderTemplate>
303+
</schedule:SchedulerResourceView>
304+
</schedule:SfScheduler.ResourceView>
305+
</schedule:SfScheduler>
306+
307+
{% endhighlight %}
308+
{% highlight c# tabtitle="MainPage.xaml.cs" %}
309+
310+
var Resources = new ObservableCollection<SchedulerResource>()
311+
{
312+
new SchedulerResource() { Name = "Sophia", Id = "1000" },
313+
new SchedulerResource() { Name = "Zoey Addison", Id = "1001" },
314+
new SchedulerResource() { Name = "James William", Id = "1002" },
315+
};
316+
317+
this.Scheduler.ResourceView.Resources = Resources;
318+
this.Scheduler.ResourceView.AdaptiveHeaderTemplate = new DataTemplate(() =>
319+
{
320+
var grid = new Grid
321+
{
322+
Padding = 8,
323+
BackgroundColor = Colors.PaleGreen
324+
};
325+
326+
var stack = new HorizontalStackLayout
327+
{
328+
Spacing = 8,
329+
VerticalOptions = LayoutOptions.Center
330+
};
331+
332+
var menuLabel = new Label
333+
{
334+
Text = "☰",
335+
FontSize = 16,
336+
TextColor = Colors.Red,
337+
VerticalTextAlignment = TextAlignment.Center,
338+
HorizontalTextAlignment = TextAlignment.Center,
339+
Margin = new Thickness(0, 0, 12, 0)
340+
};
341+
342+
var tap = new TapGestureRecognizer();
343+
tap.Tapped += OnTapped;
344+
menuLabel.GestureRecognizers.Add(tap);
345+
var nameLabel = new Label
346+
{
347+
FontAttributes = FontAttributes.Bold,
348+
FontSize = 14,
349+
TextColor = Colors.DarkViolet
350+
};
351+
352+
nameLabel.SetBinding(Label.TextProperty, "Resource.Name");
353+
stack.Add(menuLabel);
354+
stack.Add(nameLabel);
355+
grid.Add(stack);
356+
return grid;
357+
});
358+
359+
private void OnTapped(object sender, TappedEventArgs e)
360+
{
361+
if (sender is Label label && label.BindingContext is SchedulerAdaptiveResource resource)
362+
{
363+
resource.ToggleResourceDrawerView();
364+
}
365+
}
366+
367+
{% endhighlight %}
368+
{% endtabs %}
369+
370+
![customize-adapter-header-template-in-maui-scheduler](images/resource-view/customize-adapter-header-template-in-maui-scheduler.png)
371+
372+
N>
373+
374+
* The BindingContext of the `AdaptiveHeaderTemplate` is the `SchedulerAdaptiveResource.`
375+
* The `ToggleResourceDrawerView` method should be called on the `SchedulerAdaptiveResource` instance obtained from the control’s BindingContext. It toggles the visibility of the drawer resource view. It is used only when the `AdaptiveHeaderTemplate` is applied.
376+
377+
### Customize drawer resource appearance using DataTemplate
378+
379+
The drawer resource appearance customization can be achieved by using the `DrawerResourceTemplate` property of [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html?tabs=tabid-13%2Ctabid-6) in the [SfScheduler](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SfScheduler.html).
380+
381+
{% tabs %}
382+
{% highlight xaml tabtitle="MainPage.xaml" %}
383+
384+
<ContentPage.Resources>
385+
<DataTemplate x:Key="drawerResourceTemplate">
386+
<Grid Background="{Binding DataItem.BackgroundBrush}">
387+
<Label Margin="10" FontAttributes="Bold" Text="{Binding DataItem.Name}" TextColor="{Binding DataItem.ForegroundBrush}"/>
388+
</Grid>
389+
</DataTemplate>
390+
</ContentPage.Resources>
391+
392+
<scheduler:SfScheduler x:Name="scheduler">
393+
<scheduler:SfScheduler.ResourceView>
394+
<scheduler:SchedulerResourceView DrawerResourceTemplate="{StaticResource drawerResourceTemplate}">
395+
<scheduler:SchedulerResourceView.Mapping>
396+
<scheduler:SchedulerResourceMapping
397+
Id = "Id"
398+
Name="Name"
399+
Background="BackgroundColor"
400+
Foreground="ForegroundColor"/>
401+
</scheduler:SchedulerResourceView.Mapping>
402+
</scheduler:SchedulerResourceView>
403+
</scheduler:SfScheduler.ResourceView>
404+
</scheduler:SfScheduler>
405+
406+
{% endhighlight %}
407+
{% highlight c# tabtitle="MainPage.xaml.cs" %}
408+
409+
public class Employee
410+
{
411+
public string Name { get; set; }
412+
public object Id { get; set; }
413+
public Brush BackgroundBrush { get; set; }
414+
public Brush ForegroundBrush { get; set; }
415+
}
416+
417+
var Resources = new ObservableCollection<Employee>()
418+
{
419+
new Employee() { Name = "Sophia", Id = "1000", BackgroundBrush = Brush.PaleGreen, ForegroundBrush = Brush.Black },
420+
new Employee() { Name = "Zoey Addison", Id = "1001", BackgroundBrush = Brush.SkyBlue, ForegroundBrush = Brush.Black },
421+
new Employee() { Name = "James William", Id = "1002", BackgroundBrush = Brush.LightPink, ForegroundBrush = Brush.Black },
422+
};
423+
424+
this.scheduler.ResourceView.Resources = Resources;
425+
426+
{% endhighlight %}
427+
{% endtabs %}
428+
429+
![customize-drawer-resource-template-in-maui-scheduler](images/resource-view/customize-drawer-resource-template-in-maui-scheduler.png)
430+
431+
N> The BindingContext of the `DrawerResourceTemplate` is the [SchedulerResource.](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResource.html) and the custom data object can be bound in `DrawerResourceTemplate` by using `SchedulerResource.DataItem`.
432+
175433
## Visible Resource Count
176434

177435
The number of resources shown in the day, week, work week, timelineday, timelineweek, timelineworkweek views can be controlled using the [`VisibleResourceCount`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_VisibleResourceCount) property of the [`SchedulerResourceView`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_Resources) class. This lets you define how many resources are visible at a time.

0 commit comments

Comments
 (0)