
[ContentProperty("InitialParts")] [TemplatePart(Name="Panel", Type=Northwoods.GoXam.DiagramPanel)] [StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)] [XmlLangProperty("Language")] [UsableDuringInitialization(true)] [RuntimeNameProperty("Name")] [UidProperty("Uid")] [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)] [NameScopeProperty("NameScope", System.Windows.NameScope)] public class Palette : Diagram
You will need to initialize the palette's 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. It also re-layouts automatically whenever the viewport size changes, because the size of the DiagramPanel changes or because the scale changes.
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.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
Northwoods.GoXam.Diagram
Northwoods.GoXam.Palette