コード例 #1
0
		private void OnElementDragDropCompleted(object sender, DragEventArgs e)
		{
			MindmapShapeBase newShape;
			if (this.DraggingCandidate is MindmapRootShape)
				newShape = new MindmapFirstLevelShape();
			else
				newShape = new MindmapOuterShape();

			this.AddShape(newShape, this.GetTransformedPoint(e.GetPosition(this)), true);
			this.AddConnection(new RadDiagramConnection
			{
				Source = this.DraggingCandidate,
				Target = newShape
			}, true);

			this.DraggingCandidate = null;
			e.Handled = true;
		}
コード例 #2
0
		private void ToggleChildrenVisibilityRecursively(Visibility nextVisibility, MindmapShapeBase shape)
		{
			if (shape == null || nextVisibility == System.Windows.Visibility.Visible && shape.AreChildrenVisible == false)
				return;

			foreach (var connection in this.ParentDiagram.GetOutgoingConnectionsForShape(shape))
			{
				connection.Visibility = nextVisibility;
				if (!shape.Equals(connection.Target) && connection.Target != null)
				{
					connection.Target.Visibility = nextVisibility;
					this.ToggleChildrenVisibilityRecursively(nextVisibility, connection.Target as MindmapShapeBase);
				}
			}
		}