Class Diagram
[TemplatePart(Name = "NodeLayer", Type = typeof(NodeLayer))]
[TemplatePart(Name = "LinkLayer", Type = typeof(LinkLayer))]
[TemplatePart(Name = "DynamicLayer", Type = typeof(LinkLayer))]
public class Diagram : ContentControl, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, IDiagram
- Inheritance
-
Diagram
- Implements
- Inherited Members
- Extension Methods
Constructors
Diagram()
public Diagram()
Fields
AddLinkedRoutedEvent
public static readonly RoutedEvent AddLinkedRoutedEvent
Field Value
AddNodedRoutedEvent
public static readonly RoutedEvent AddNodedRoutedEvent
Field Value
DataSourceProperty
public static readonly DependencyProperty DataSourceProperty
Field Value
DynamicLinkStyleProperty
public static readonly DependencyProperty DynamicLinkStyleProperty
Field Value
ItemsChangedRoutedEvent
public static readonly RoutedEvent ItemsChangedRoutedEvent
Field Value
LayoutProperty
public static readonly DependencyProperty LayoutProperty
Field Value
LinkDrawerProperty
public static readonly DependencyProperty LinkDrawerProperty
Field Value
LinkStyleProperty
public static readonly DependencyProperty LinkStyleProperty
Field Value
MessageProperty
public static readonly DependencyProperty MessageProperty
Field Value
NodeStyleProperty
public static readonly DependencyProperty NodeStyleProperty
Field Value
SelectedNodeProperty
public static readonly DependencyProperty SelectedNodeProperty
Field Value
SelectedPartChangedRoutedEvent
public static readonly RoutedEvent SelectedPartChangedRoutedEvent
Field Value
SelectedPartProperty
public static readonly DependencyProperty SelectedPartProperty
Field Value
UseAutoAddLinkOnEndProperty
public static readonly DependencyProperty UseAutoAddLinkOnEndProperty
Field Value
Properties
DataSource
public IDiagramDataSource DataSource { get; set; }
Property Value
DefaultKey
public static ComponentResourceKey DefaultKey { get; }
Property Value
DynamicLayer
[Browsable(false)]
public LinkLayer DynamicLayer { get; }
Property Value
DynamicLinkStyle
[Browsable(false)]
public Style DynamicLinkStyle { get; set; }
Property Value
Layout
[Display(Name = "布局方式", GroupName = "显示设置")]
public ILayout Layout { get; set; }
Property Value
LinkDrawer
[Browsable(false)]
public ILinkDrawer LinkDrawer { get; set; }
Property Value
LinkLayer
[Browsable(false)]
public LinkLayer LinkLayer { get; }
Property Value
LinkStyle
[Browsable(false)]
public Style LinkStyle { get; set; }
Property Value
LinkTemplate
[Browsable(false)]
public DataTemplate LinkTemplate { get; set; }
Property Value
Links
[Browsable(false)]
public List<Link> Links { get; }
Property Value
Message
[Browsable(false)]
public string Message { get; set; }
Property Value
NodeLayer
[Browsable(false)]
public NodeLayer NodeLayer { get; }
Property Value
NodeStyle
[Browsable(false)]
public Style NodeStyle { get; set; }
Property Value
Nodes
[Browsable(false)]
public List<Node> Nodes { get; }
Property Value
SelectedNode
[Display(Name = "选中节点", GroupName = "显示设置")]
public Node SelectedNode { get; set; }
Property Value
SelectedPart
[Display(Name = "选中部位", GroupName = "显示设置")]
public Part SelectedPart { get; set; }
Property Value
UseAnimation
[Display(Name = "启用切换布局动画", GroupName = "显示设置")]
public bool UseAnimation { get; set; }
Property Value
UseAutoAddLinkOnEnd
public bool UseAutoAddLinkOnEnd { get; set; }
Property Value
Methods
AddLink(Link)
public void AddLink(Link link)
Parameters
link
Link
AddNode(params Node[])
public void AddNode(params Node[] nodes)
Parameters
nodes
Node[]
Clear()
protected void Clear()
GetAllParts(Func<Part, bool>)
public IEnumerable<Part> GetAllParts(Func<Part, bool> predicate = null)
Parameters
Returns
InvokeMessage(string)
public virtual void InvokeMessage(string message)
Parameters
message
string
OnAddNoded(IEnumerable<Node>)
protected void OnAddNoded(IEnumerable<Node> nodes)
Parameters
nodes
IEnumerable<Node>
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
e
MouseButtonEventArgsThe MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed.
OnSelectedPartChanged()
protected void OnSelectedPartChanged()
RefreshData()
public void RefreshData()
RefreshLayout()
public void RefreshLayout()
RefreshLinkDrawer()
public void RefreshLinkDrawer()
RemoveNode(params Node[])
public void RemoveNode(params Node[] nodes)
Parameters
nodes
Node[]
UpdateNodesToDataSource()
protected void UpdateNodesToDataSource()
ZoomTo(Part, double)
public void ZoomTo(Part part, double scale = 1.8)
Parameters
ZoomTo(Point)
public void ZoomTo(Point point)
Parameters
point
Point
ZoomTo(Rect, double)
public void ZoomTo(Rect rect, double scale = 1.8)
Parameters
ZoomToFit(double)
public void ZoomToFit(double scale = 1.2)
Parameters
scale
double
ZoomToFit(double, params Part[])
public void ZoomToFit(double scale = 1.2, params Part[] parts)
Parameters
ZoomToSelectPart()
public void ZoomToSelectPart()
Events
AddLinked
public event EventHandler<RoutedEventArgs<Link>> AddLinked
Event Type
AddNoded
public event RoutedEventHandler AddNoded
Event Type
ItemsChanged
public event RoutedEventHandler ItemsChanged
Event Type
SelectedPartChanged
public event RoutedEventHandler SelectedPartChanged