Search
Palette Class
Remarks See Also
 





Represents a tool palette control that displays DiagramItem objects grouped into categories. Items from the palette can be added to a diagram by drag-and-drop.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public class Palette : Control

Visual Basic  Copy Code

Public Class Palette
    Inherits Control

 Remarks

The Palette control represents a tool palette that displays DiagramItem objects grouped into categories. It implements Accordion user interface that displays ItemListView components as its child panels, and category icon, title and collapse/expand button in pane headers. Each child ItemListView displays the items added to its corresponding category.

Call the AddCategory method to define a category and create its respective accordion pane. Call AddItem to add an item to specified category. The control can also be populated by setting ItemsSource to a list of PaletteCategory objects.

Palette provides same behavior and appearance properties as the ItemListView class.

Drag-and-drop operations create a copy of the dragged item, and set its size to NewInstanceSize. The copy is created by calling item's Clone method. You can override Clone to copy property values of custom item subclasses.

 Example

C#  Copy Code
var bpmnCategory = palette.AddCategory("BPMN");
palette.AddItem(
    new ShapeNode { Shape = Shapes.BpmnComplex },
    bpmnCategory, "BpmnComplex");
palette.AddItem(
    new ShapeNode { Shape = Shapes.BpmnEndCancel },
    bpmnCategory, "BpmnEndCancel");

 Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
        System.Windows.DependencyObject
            System.Windows.Media.Visual
                System.Windows.UIElement
                    System.Windows.FrameworkElement
                        System.Windows.Controls.Control
                            MindFusion.Diagramming.Wpf.Palette

 See Also