Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions MAUI/Scheduler/drag-and-drop-appointments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
Title: Appointment Drag and Drop in .NET MAUI Scheduler Control | Syncfusion<sup>&reg;</sup>
Description: Learn here all about Appointment drag and drop support in the Syncfusion<sup>&reg;</sup> .NET MAUI Scheduler(SfScheduler) control.
title: Appointment Drag and Drop in .NET MAUI Scheduler Control | Syncfusion®
description: Learn here all about Appointment drag and drop support in the Syncfusion<sup>&reg;</sup> .NET MAUI Scheduler(SfScheduler) control.
platform: maui
control: SfScheduler
documentation: ug
Expand Down Expand Up @@ -98,6 +98,7 @@ Using the [AppointmentDrop](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.
[DropTime](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.AppointmentDropEventArgs.html#Syncfusion_Maui_Scheduler_AppointmentDropEventArgs_DropTime) - Get or set the date and time at which the appointment is being dropped.
[SourceResource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.AppointmentDropEventArgs.html#Syncfusion_Maui_Scheduler_AppointmentDropEventArgs_SourceResource) - Get the original resource of the appointment that is being dropped.
[TargetResource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.AppointmentDropEventArgs.html#Syncfusion_Maui_Scheduler_AppointmentDropEventArgs_TargetResource) - Get the resource into which the appointment is being dropped.
`IsDroppingToAllDay` - Gets a value indicating whether an appointment is being dropped into an all-day slot.

{% tabs %}
{% highlight c# %}
Expand All @@ -107,10 +108,31 @@ scheduler.AppointmentDrop += OnSchedulerAppointmentDrop;

private void OnSchedulerAppointmentDrop(object? sender, AppointmentDropEventArgs e)
{
var appointment = e.Appointment;
e.Cancel = false;
var dropTime = e.DropTime;
var appointment = e.Appointment;
e.Cancel = false;
var dropTime = e.DropTime;
}

{% endhighlight %}
{% endtabs %}

### Prevent dropping appointments into the all-day panel

You can prevent appointments from being dropped into the all-day panel by checking the `IsDroppingToAllDay` property in the `AppointmentDrop` event and canceling the operation.

{% tabs %}
{% highlight c# %}
scheduler.AppointmentDrop += OnSchedulerAppointmentDrop;
...

private void OnSchedulerAppointmentDrop(object? sender, AppointmentDropEventArgs e)
{
if (e.IsDroppingToAllDay)
{
e.Cancel = true;
}
}

{% endhighlight %}
{% endtabs %}

Expand Down
24 changes: 24 additions & 0 deletions MAUI/Scheduler/month-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ this.Scheduler.MonthView.AppointmentIndicatorCount = 1;

![change-appointment-indicator-count-in-maui-scheduler](images/month-view/change-appointment-indicator-count-in-maui-scheduler.jpeg)

## Appointment indicator size

The scheduler month view allows you to customize the size of the appointment indicator by using the `AppointmentIndicatorSize` property of the [MonthView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerMonthView.html). By default, the `AppointmentIndicatorSize` is set to 6d.

{% tabs %}
{% highlight XAML hl_lines="5" %}

<schedule:SfScheduler x:Name="Scheduler"
View="Month" >
<schedule:SfScheduler.MonthView>
<schedule:SchedulerMonthView AppointmentDisplayMode="Indicator" AppointmentIndicatorSize="10"/>
</schedule:SfScheduler.MonthView>
</schedule:SfScheduler>

{% endhighlight %}
{% highlight C# hl_lines="3" %}

this.Scheduler.View = SchedulerView.Month;
this.Scheduler.MonthView.AppointmentDisplayMode = SchedulerMonthAppointmentDisplayMode.Indicator;
this.Scheduler.MonthView.AppointmentIndicatorSize = 10;

{% endhighlight %}
{% endtabs %}

## Hide leading and trailing dates

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.`
Expand Down
69 changes: 63 additions & 6 deletions MAUI/Scheduler/resource-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,47 @@ this.Scheduler.ResourceView.ResourceGroupType = SchedulerResourceGroupType.Date;

![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)

## Visible Resource Count in Days View
## Visible Resource Count

The number of resources shown in the day, week, and work week 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.
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.

### Days View

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="3" %}
<schedule:SfScheduler x:Name="Scheduler" View="Day" >
<schedule:SfScheduler.ResourceView>
<schedule:SchedulerResourceView VisibleResourceCount="6"/>
</schedule:SfScheduler.ResourceView>
</schedule:SfScheduler>
{% endhighlight %}
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="12" %}
var Resources = new ObservableCollection<SchedulerResource>()
{
new SchedulerResource { Name = "Sophia", Foreground = Colors.White, Background = Colors.LightGreen, Id = "1000" },
new SchedulerResource { Name = "Zoey Addison", Foreground = Colors.White, Background = Colors.Gold, Id = "1001" },
new SchedulerResource { Name = "Aiden Clark", Foreground = Colors.White, Background = Colors.LightSkyBlue,Id = "1002" },
new SchedulerResource { Name = "Mia Johnson", Foreground = Colors.White, Background = Colors.Tomato, Id = "1003" },
new SchedulerResource { Name = "Liam Parker", Foreground = Colors.White, Background = Colors.Orchid, Id = "1004" },
new SchedulerResource { Name = "Olivia Bennett", Foreground = Colors.White, Background = Colors.SlateBlue, Id = "1005" },
new SchedulerResource { Name = "Noah Ramirez", Foreground = Colors.White, Background = Colors.SeaGreen, Id = "1006" },
new SchedulerResource { Name = "Ava Thompson", Foreground = Colors.White, Background = Colors.Coral, Id = "1007" },
new SchedulerResource { Name = "Ethan Davis", Foreground = Colors.White, Background = Colors.DodgerBlue, Id = "1008" },
new SchedulerResource { Name = "Isabella Moore", Foreground = Colors.White, Background = Colors.MediumOrchid,Id = "1009" },
};

this.Scheduler.ResourceView.Resources = Resources;
this.Scheduler.ResourceView.VisibleResourceCount = 6;
{% endhighlight %}
{% endtabs %}

![Visible Resource Count in Days View in .NET MAUI Scheduler.](images/resource-view/visible-resource-count-for-resources-in-days-view-in-.net-maui-scheduler.png)

### Timeline View

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="3" %}
<schedule:SfScheduler x:Name="Scheduler" View="TimelineDay" >
<schedule:SfScheduler.ResourceView>
<schedule:SchedulerResourceView VisibleResourceCount="4"/>
</schedule:SfScheduler.ResourceView>
Expand All @@ -200,11 +234,9 @@ this.Scheduler.ResourceView.VisibleResourceCount = 4;
{% endhighlight %}
{% endtabs %}

![Visible Resource Count in Days View in .NET MAUI Scheduler.](images/resource-view/visible-resource-count-for-resources-in-days-view-in-.net-maui-scheduler.png)

N>
* When [`VisibleResourceCount`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_VisibleResourceCount) is set to -1, the `SfScheduler` displays up to three resources. If the total number of resources is less than three, it displays all available resources.
* When [`VisibleResourceCount`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_VisibleResourceCount) is set to 0, the resource view layout is removed, and only the plain Scheduler view (e.g., Day view without resources) is shown.
* When [`VisibleResourceCount`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_VisibleResourceCount) is set to 0, the resource view layout is removed, and only the plain Scheduler view is shown.
* [`VisibleResourceCount`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_VisibleResourceCount) applies to the horizontal resource view on Windows and macOS, and to the timeline resource view on all platforms. When the value is -1 (default), the horizontal resource view displays three resources. In timeline resource views, the number of visible resource rows is determined by the minimum row height, and the auto row height.

## Resource Header Height in Days View

Expand Down Expand Up @@ -233,6 +265,31 @@ this.Scheduler.ResourceView.ResourceHeaderHeight = 100;

![Resource Header Height in Days View in .NET MAUI Scheduler.](images/resource-view/resource-header-height-for-resources-in-days-view-in-.net-maui-scheduler.png)

## Resource Header Width in Timeline View

In the timelineday, timelineweek, and timeline work week views, resources are arranged vertically. The width of the resource headers can be customized using the `ResourceHeaderWidth` property of the [`SchedulerResourceView`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_Resources) class.

{% tabs %}
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="3" %}
<schedule:SfScheduler x:Name="Scheduler" View="TimelineDay" >
<schedule:SfScheduler.ResourceView>
<schedule:SchedulerResourceView ResourceHeaderWidth="250"/>
</schedule:SfScheduler.ResourceView>
</schedule:SfScheduler>
{% endhighlight %}
{% highlight C# tabtitle="MainPage.xaml.cs" hl_lines="9" %}
var Resources = new ObservableCollection<SchedulerResource>()
{
new SchedulerResource() { Name = "Sophia", Foreground = Colors.White, Background = Colors.LightGreen, Id = "1000" },
new SchedulerResource() { Name = "Zoey Addison", Foreground = Colors.White, Background = Colors.Gold, Id = "1001" },
new SchedulerResource() { Name = "James William", Foreground = Colors.White, Background = Colors.Violet, Id = "1002" },
};

this.Scheduler.ResourceView.Resources = Resources;
this.Scheduler.ResourceView.ResourceHeaderWidth = 250;
{% endhighlight %}
{% endtabs %}

## Resource minimum row height

You can customize resource minimum row height of visible resources in timeline day, timeline week, timeline workweek and timeline month views by using the [MinimumRowHeight](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html#Syncfusion_Maui_Scheduler_SchedulerResourceView_MinimumRowHeight) property of [SchedulerResourceView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerResourceView.html) in [SfScheduler.](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SfScheduler.html) By default, resource row height will be auto-expanded from minimum height based on the appointment counts.
Expand Down
92 changes: 91 additions & 1 deletion MAUI/Segmented-Control/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,94 @@ Use the [SegmentTemplate](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Bu
{% endhighlight %}
{% endtabs %}

![Appearance customization using DataTemplate in .NET MAUI Segmented control.](images/customization/segment-template.png)
![Appearance customization using DataTemplate in .NET MAUI Segmented control.](images/customization/segment-template.png)

## Customize selected segment item appearance using DataTemplate

Use the `IsSelected` property of `SfSegmentItem` to customize the selected segment item appearance. The following example code shows how to create a custom segmented control using a data template.

{% tabs %}
{% highlight XAML %}

<ContentPage
xmlns:buttons="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons">
<ContentPage.Resources>
<ResourceDictionary>
<local:TextColorConverter x:Key="TextColorConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout Spacing="20" VerticalOptions="Center">
<buttons:SfSegmentedControl x:Name="segmentedControl">
<buttons:SfSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</x:Array>
</buttons:SfSegmentedControl.ItemsSource>
<buttons:SfSegmentedControl.SegmentTemplate>
<DataTemplate>
<Grid BackgroundColor="LightCyan">
<Label Text="{Binding Text}"
TextColor="{Binding IsSelected, Converter={StaticResource TextColorConverter}}"
FontAttributes="Bold"
Margin="6"/>
</Grid>
</DataTemplate>
</buttons:SfSegmentedControl.SegmentTemplate>
</buttons:SfSegmentedControl>
</StackLayout>
</ContentPage>

{% endhighlight %}
{% highlight C# tabtitle="MainPage.xaml.cs" %}

using Syncfusion.Maui.Buttons;
. . .

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfSegmentedControl segmentedControl = new SfSegmentedControl();
List<SfSegmentItem> segmentItems = new List<SfSegmentItem>
{
new SfSegmentItem() {Text="Day", Background = Colors.LightBlue},
new SfSegmentItem() {Text="Week", Background = Colors.LightBlue},
new SfSegmentItem() {Text="Month", Background = Colors.LightBlue},
new SfSegmentItem() {Text="Year", Background = Colors.LightBlue},
};
segmentedControl.ItemsSource = segmentItems;
this.Content = segmentedControl;
}
}

{% endhighlight %}
{% highlight C# tabtitle="TextColorConverter.cs" %}

public class TextColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isSelected)
{
return isSelected ? Colors.Green : Colors.Red;
}

return Colors.Black;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
}
}

{% endhighlight %}
{% endtabs %}

N>
* The BindingContext of the `SegmentTemplate` is the `SfSegmentItem`.

![Customization for the selected segment item in .NET MAUI Segmented control.](images/customization/selected-segment.png)
59 changes: 59 additions & 0 deletions MAUI/Segmented-Control/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
layout: post
title: Events in .NET MAUI Segmented control | Syncfusion
description: Learn here all about the Events support in Syncfusion<sup>&reg;</sup> .NET MAUI Segmented Control (SfSegmentedControl).
platform: maui
control: SfSegmentedControl
documentation: ug
---

# Events in .NET MAUI Segmented Control (SfSegmentedControl)

The Segmented Control supports the `Tapped,` and `SelectionChanged` events to interact with .NET MAUI Segmented Control

## Tapped

A Tapped event occurs, each time a segment tapped.

Below is a list of the arguments:

* `Sender`: This contains the `SfSegmentedControl` object.

* `Tapped`: The tapped action performed on an Segment can be found in the `SegmentTappedEventArgs`, you can see details about the `SegmentItem`.

## SelectionChanged

The [SelectionChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentedControl.html#Syncfusion_Maui_Buttons_SfSegmentedControl_SelectionChanged) event is triggered once the segment is selected in the segmented control. The [SelectionChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SelectionChangedEventArgs.html) has the following values, which provide information for the `SelectionChanged` event.

* OldIndex
* NewIndex
* OldValue
* NewValue

{% tabs %}
{% highlight C# %}

using Syncfusion.Maui.Buttons;
. . .

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SfSegmentedControl segmentedControl = new SfSegmentedControl();
segmentedControl.SelectionChanged += OnSegmentedControlSelectionChanged;
this.Content = segmentedControl;
}

private void OnSegmentedControlSelectionChanged(object sender, Syncfusion.Maui.Buttons.SelectionChangedEventArgs e)
{
var newValue = e.NewValue;
var oldValue = e.OldValue;
var newIndex = e.NewIndex;
var oldIndex = e.OldIndex;
}
}

{% endhighlight %}
{% endtabs %}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading