Class ColorMapping
Provides the color indication support which includes the indication properties.
Inheritance
Namespace: Syncfusion.UI.Xaml.Kanban
Assembly: Syncfusion.SfKanban.WPF.dll
Syntax
public class ColorMapping : DependencyObject
Constructors
ColorMapping()
Declaration
public ColorMapping()
Fields
ColorProperty
Using a DependencyProperty as the backing store for Color. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
KeyProperty
Using a DependencyProperty as the backing store for Key. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty KeyProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
Color
Gets or sets a color value for the associated Key.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Color | The default value of Color is System.Windows.Media.Colors.Transparent. |
Remarks
This color is used to identify or categorize items based on key properties within the model. It helps in visually distinguishing different categories or priorities of kanban cards.
Examples
The below examples shows, how to set Color property of
<kanban:SfKanban x:Name="kanban"
ItemsSource="{Binding TaskDetails}">
<kanban:SfKanban.DataContext>
<local:ViewModel />
</kanban:SfKanban.DataContext>
<kanban:SfKanban.IndicatorColorPalette>
<kanban:KanbanColorMapping Key = "High" Color="Red"/>
</kanban:SfKanban.IndicatorColorPalette>
<kanban:KanbanColumn MaximumCount="10"
HeaderText="Open"
Categories="Open">
<kanban:KanbanColumn.ErrorBarSettings>
<kanban:KanbanErrorBarSettings MaximumValidationColor="Red" />
</kanban:KanbanColumn.ErrorBarSettings>
</kanban:KanbanColumn>
</kanban:SfKanban>
# [C#](#tab/tabid-5)
public class ViewModel
{
public ViewModel()
{
TaskDetails = new ObservableCollection<KanbanModel>();
TaskDetails.Add(new KanbanModel()
{
Title = "Universal App",
Id = "6593",
Description = "Draft preliminary software specifications",
Category = "Review",
IndicatorColorKey = "High",
Tags = new List<string> { "Analysis" },
});
}
public ObservableCollection<KanbanModel> TaskDetails { get; set; }
}
# [C#](#tab/tabid-6)
this.kanban.ItemsSource = new ViewModel().TaskDetails;
this.kanban.IndicatorColorPalette = new KanbanColorMapping()
{
Color = Colors.Red,
Key = "High"
};
this.kanban.Columns.Add(new KanbanColumn()
{
Categories = "Open",
MaximumCount=10,
ErrorBarSettings = new KanbanErrorBarSettings()
{
MaximumValidationColor = new SolidColorBrush(Colors.Red),
}
});
See Also
Key
Gets or sets a value which will be the color key in the KanbanModel item.
Declaration
public object Key { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value of Key is null. |
Remarks
This key is used to identify or categorize items based on color within the model. It helps in visually distinguishing different categories or priorities of kanban cards.
Examples
The below examples shows, how to set Key property of
<kanban:SfKanban x:Name="kanban"
ItemsSource="{Binding TaskDetails}">
<kanban:SfKanban.DataContext>
<local:ViewModel />
</kanban:SfKanban.DataContext>
<kanban:SfKanban.IndicatorColorPalette>
<kanban:KanbanColorMapping Key = "High" Color="Red"/>
</kanban:SfKanban.IndicatorColorPalette>
<kanban:KanbanColumn MaximumCount="10"
HeaderText="Open"
Categories="Open">
<kanban:KanbanColumn.ErrorBarSettings>
<kanban:KanbanErrorBarSettings MaximumValidationColor="Red" />
</kanban:KanbanColumn.ErrorBarSettings>
</kanban:KanbanColumn>
</kanban:SfKanban>
# [C#](#tab/tabid-2)
public class ViewModel
{
public ViewModel()
{
TaskDetails = new ObservableCollection<KanbanModel>();
TaskDetails.Add(new KanbanModel()
{
Title = "Universal App",
Id = "6593",
Description = "Draft preliminary software specifications",
Category = "Review",
IndicatorColorKey = "High",
Tags = new List<string> { "Analysis" },
});
}
public ObservableCollection<KanbanModel> TaskDetails { get; set; }
}
# [C#](#tab/tabid-3)
this.kanban.ItemsSource = new ViewModel().TaskDetails;
this.kanban.IndicatorColorPalette = new KanbanColorMapping()
{
Color = Colors.Red,
Key = "High"
};
this.kanban.Columns.Add(new KanbanColumn()
{
Categories = "Open",
MaximumCount=10,
ErrorBarSettings = new KanbanErrorBarSettings()
{
MaximumValidationColor = new SolidColorBrush(Colors.Red),
}
});