Palette
control is a Diagram that holds parts that can be dragged to a Diagram.
You will need to initialize the palette's Diagram.Model with the node data with which you wish to populate the palette. For example, for the (simple) palette:
<go:Palette x:Name="myPalette" NodeTemplate="..." />you would need to perform something like the following at initialization:
myPalette.Model.NodesSource = new String[] { "Alpha", "Beta", "Gamma" };You also need to set
AllowDrop="True"
on the Diagram(s) into which users may drop the items from the palette.
It is commonplace to have a different and probably simpler node DataTemplate
for Palettes than for the destination Diagrams.
By default a palette uses a Northwoods.GoXam.Layout.GridLayout as its Layout. That GridLayout
defaults to sorting all of the nodes by the Part.Text (attached) property.
The default style for a palette also makes it IsReadOnly, and sets AllowDragOut to be true, to permit drag-and-drop operations to start from this palette and to end on other diagrams.
System.Object
System.Windows.DependencyObject
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
Northwoods.GoXam.Diagram
Northwoods.GoXam.Palette