Class SfKanban
Represents a Kanban control which is used for visualizing and managing the workflow of any process, like the software development process, in an effective way.
Inheritance
Namespace: Syncfusion.SfKanban.XForms
Assembly: Syncfusion.SfKanban.XForms.dll
Syntax
public class SfKanban : View, IParentThemeElement, IThemeElement
Remarks
KanbanColumn type will be the default content in the XAML representation of Kanban.
Constructors
SfKanban()
Initializes a new instance of the SfKanban class.
Declaration
public SfKanban()
Fields
ActualColumnsProperty
Identifies the ActualColumns bindable property.
Declaration
public static readonly BindableProperty ActualColumnsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
AutoGenerateColumnsProperty
Identifies the AutoGenerateColumns bindable property.
Declaration
public static readonly BindableProperty AutoGenerateColumnsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CardTappedCommandParameterProperty
Identifies the CardTappedCommandParameter bindable property. Gets or sets a parameter to pass to the CardTappedCommand.
Declaration
public static readonly BindableProperty CardTappedCommandParameterProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CardTappedCommandProperty
Identifies the CardTappedCommand bindable property. It invokes when a card item is tapped.
Declaration
public static readonly BindableProperty CardTappedCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CardTemplateProperty
Identifies the CardTemplate bindable property.
Declaration
public static readonly BindableProperty CardTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColorModelProperty
Identifies the ColorModel bindable property.
Declaration
public static readonly BindableProperty ColorModelProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColumnMappingPathProperty
Identifies the ColumnMappingPath bindable property.
Declaration
public static readonly BindableProperty ColumnMappingPathProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColumnsProperty
Identifies the Columns bindable property.
Declaration
public static readonly BindableProperty ColumnsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColumnWidthProperty
Identifies the ColumnWidth bindable property.
Declaration
public static readonly BindableProperty ColumnWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
HeaderTemplateProperty
Identifies the HeaderTemplate bindable property.
Declaration
public static readonly BindableProperty HeaderTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemsSourceProperty
Identifies the ItemsSource bindable property.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MaximumColumnWidthProperty
Identifies the MaximumColumnWidth bindable property.
Declaration
public static readonly BindableProperty MaximumColumnWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MinimumColumnWidthProperty
Identifies the MinimumColumnWidth bindable property.
Declaration
public static readonly BindableProperty MinimumColumnWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
PlaceholderStyleProperty
Identifies the PlaceholderStyle bindable property.
Declaration
public static readonly BindableProperty PlaceholderStyleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
WorkflowsProperty
Identifies the Workflows bindable property.
Declaration
public static readonly BindableProperty WorkflowsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
ActualColumns
Gets the auto-generated KanbanColumns.
Declaration
public KanbanColumnCollection ActualColumns { get; }
Property Value
Type |
---|
KanbanColumnCollection |
Remarks
If AutoGenerateColumns is set to true and also Columns are defined by user, this property will contain both the auto-generated KanbanColumns and also user specified Columns. If AutoGenerateColumns is set to false, this property will contain only the user specified columns.
AutoGenerateColumns
Gets or sets a value indicating whether the KanbanColumn can be auto-generated based on the ColumnMappingPath value.
Declaration
public bool AutoGenerateColumns { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
A KanbanColumn will be generated automatically only if the user does not specify the KanbanColumn explicitly for a category using Columns property.
CardTappedCommand
Gets or sets the command to invoke when a card item is tapped.
Declaration
public ICommand CardTappedCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The card tapped command. |
CardTappedCommandParameter
Gets or sets a parameter to pass to the CardTappedCommand.
Declaration
public object CardTappedCommandParameter { get; set; }
Property Value
Type |
---|
System.Object |
CardTemplate
Gets or sets a template for the Kanban card view.
Declaration
public DataTemplate CardTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | DataTemplate as its value. |
ColorModel
Gets or sets the list of KanbanColorMapping, which is used to define the colors for each key.
Declaration
public List<KanbanColorMapping> ColorModel { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<KanbanColorMapping> | List of KanbanColorMapping. |
Remarks
To have a color indicator in the card, define the ColorModel and map the ColorKey value to the corresponding KanbanModel item's ColorKey property.
Examples
List<KanbanColorMapping> colormodels = new List<KanbanColorMapping>();
colormodels.Add(new KanbanColorMapping("Green", Color.Green));
colormodels.Add(new KanbanColorMapping("Red", Color.Red));
colormodels.Add(new KanbanColorMapping("Aqua", Color.Aqua));
colormodels.Add(new KanbanColorMapping("Blue", Color.Blue));
Kanban.ColorModel = colormodels;
ColumnMappingPath
Gets or sets a property name, which is used to categorize the columns.
Declaration
public string ColumnMappingPath { get; set; }
Property Value
Type |
---|
System.String |
Remarks
If a list of KanbanModel is bound to ItemsSource property, SfKanban will automatically categorize the items using Category property. If ItemsSource contains custom objects, the path of the property which can be used to categorize the card should be explicitly defined using this property.
Columns
Gets or sets the collection of KanbanColumn that belongs to SfKanban.
Declaration
public KanbanColumnCollection Columns { get; set; }
Property Value
Type | Description |
---|---|
KanbanColumnCollection | Type: KanbanColumnCollection A KanbanColumnCollection that contains the collection of KanbanColumn objects. |
Remarks
This is the ContentProperty of the SfKanban. A KanbanColumnCollection determines the schema of the SfKanban.
Examples
<kanban:SfKanban>
<kanban:KanbanColumn> <kanban:KanbanColumn/>
<kanban:SfKanban/>
SfKanban kanban = new SfKanban();
KanbanColumn todoColumn = new KanbanColumn();
todoColumn.Title = "To Do";
kanban.Columns.Add(todoColumn);
ColumnWidth
Gets or sets the width of the KanbanColumn.
Declaration
public double ColumnWidth { get; set; }
Property Value
Type |
---|
System.Double |
HeaderTemplate
Gets or sets a template for the KanbanColumn's header.
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | DataTemplate as its value. |
ItemsSource
Gets or sets a collection used to generate the content of the SfKanban.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.IEnumerable |
Remarks
KanbanColumn will be populated with cards for the data in the ItemsSource. Each item in ItemsSource will be associated to a KanbanColumn using either Category property or ColumnMappingPath property depending on whether the item type is KanbanModel or custom model respectively.
MaximumColumnWidth
Gets or sets the maximum width constraint of the KanbanColumn.
Declaration
public double MaximumColumnWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property take the double value. |
MinimumColumnWidth
Gets or sets the minimum width constraint of the KanbanColumn.
Declaration
public double MinimumColumnWidth { get; set; }
Property Value
Type |
---|
System.Double |
PlaceholderStyle
Gets or sets the KanbanPlaceholderStyle instance that provides the style for a card placeholder.
Declaration
public KanbanPlaceholderStyle PlaceholderStyle { get; set; }
Property Value
Type |
---|
KanbanPlaceholderStyle |
Workflows
Gets or sets the workflows. Each KanbanWorkflow item defines the workflow for a particular category, which is used to determine the target columns a card can be dropped.
Declaration
public List<KanbanWorkflow> Workflows { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<KanbanWorkflow> | List of KanbanWorkflow. |
Examples
List<KanbanWorkflow> workflows = new List<KanbanWorkflow>();
KanbanWorkflow openWorkflow = new KanbanWorkflow();
openWorkflow.Category = "Open";
openWorkflow.AllowedTransitions = new List<object>{ "In Progress" };
workflows.Add(openWorkflow);
Kanban.Workflows = workflows;
Methods
OnMeasure(Double, Double)
Method used to measure the kanban.
Declaration
protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | Width of the kanban. |
System.Double | heightConstraint | Height of the kanban. |
Returns
Type | Description |
---|---|
Xamarin.Forms.SizeRequest | Actual size of the chart. |
Events
ColumnsGenerated
Occurs when the KanbanColumn are auto-generated.
Declaration
public event EventHandler<EventArgs> ColumnsGenerated
Event Type
Type |
---|
System.EventHandler<System.EventArgs> |
DragEnd
Occurs when the card is dropped.
Declaration
public event EventHandler<KanbanDragEndEventArgs> DragEnd
Event Type
Type |
---|
System.EventHandler<KanbanDragEndEventArgs> |
Remarks
This event can be cancelled using Cancel property. When this event is cancelled, card will not be dropped on to the target column. However, dragging will be stopped and the dragged card will stay in its source column.
DragEnter
Occurs when a card is dragged into the target KanbanColumn.
Declaration
public event EventHandler<KanbanDragEnterEventArgs> DragEnter
Event Type
Type |
---|
System.EventHandler<KanbanDragEnterEventArgs> |
Remarks
This event can be cancelled using Cancel property. When the event is cancelled, DragOver event will not be fired when the card is moved over the TargetColumn. It also means the user will not be able to drop the card over the current target column.
DragLeave
Occurs when a card is dragged out of the KanbanColumn.
Declaration
public event EventHandler<KanbanDragLeaveEventArgs> DragLeave
Event Type
Type |
---|
System.EventHandler<KanbanDragLeaveEventArgs> |
DragOver
Occurs when a card is dragged over the KanbanColumn.
Declaration
public event EventHandler<KanbanDragOverEventArgs> DragOver
Event Type
Type |
---|
System.EventHandler<KanbanDragOverEventArgs> |
Remarks
This event can be used to disallow a dragged card from being dropped on a particular position in the target column by cancelling the event using Cancel property. Current position can be determined using TargetIndex.
DragStart
Occurs when the user starts to drag a card.
Declaration
public event EventHandler<KanbanDragStartEventArgs> DragStart
Event Type
Type |
---|
System.EventHandler<KanbanDragStartEventArgs> |
Remarks
Using KeepItem property, user can set a value that will determine whether to hide the actual card in the source column while the preview of the card is being dragged. Default value is false; hence, the actual card will be hidden when a user starts to drag a card. If it is set to true, card will not be hidden. This event can be cancelled using Cancel property. When it is cancelled, card cannot be dragged.
ItemTapped
Occurs when a card is tapped.
Declaration
public event EventHandler<KanbanTappedEventArgs> ItemTapped
Event Type
Type |
---|
System.EventHandler<KanbanTappedEventArgs> |