Northwoods.GoSilverlight 1.2.2 Assembly
Palette Class
Members  See Also  Send Feedback
Northwoods.GoXam Namespace : Palette Class

The Palette control is a Diagram that holds parts that can be dragged to a Diagram.

Syntax

Visual Basic (Declaration) 
Public Class Palette 
   Inherits Diagram
C# 
public class Palette : Diagram 

Remarks

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. 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.

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Controls.Control
               Northwoods.GoXam.Diagram
                  Northwoods.GoXam.Palette

Requirements

See Also

© 2010 All Rights Reserved.