private void Diagram_UserHandleClicked(object sender, UserHandleClickedEventArgs args) { SelectedNode = diagram.SelectedItems[0] as Node; if (args.Item.Name == "Delete") { diagram.RemoveNode(SelectedNode, true); (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout(); } else if (args.Item.Name == "ExpColl") { if (SelectedNode.IsExpanded) { SelectedNode.IsExpanded = false; args.Item.Content = GetHandleImage("mindmapcollpase.png"); diagram.UserHandles[0].Visible = false; if (SelectedNode == RootNode) { diagram.UserHandles[1].Visible = false; } } else { SelectedNode.IsExpanded = true; args.Item.Content = GetHandleImage("mindmapexpand.png"); diagram.UserHandles[0].Visible = true; if (SelectedNode == RootNode) { diagram.UserHandles[1].Visible = true; } } (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout(); diagram.Select(SelectedNode); } else if (args.Item.Name == "info") { AddInfo(); } else { if (args.Item.Name == "Left") { CurrentHandle = UserHandlePosition.Left; ShowInfo(); } else if (args.Item.Name == "Right") { CurrentHandle = UserHandlePosition.Right; ShowInfo(); } } }
private void Diagram_UserHandleClicked(object sender, UserHandleClickedEventArgs args) { if (Notifier != null && Notifier.Superview == this) { Notifier.RemoveFromSuperview(); diagram.Layer.Opacity = 1; diagram.PageSettings.BackgroundColor = UIColor.White; } else if (InfoNotifier != null && InfoNotifier.Superview == this) { InfoNotifier.RemoveFromSuperview(); } else { if (args.Item.Name == "Delete") { diagram.RemoveNode(SelectedNode, true); (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout(); } else if (args.Item.Name == "ExpColl") { if (SelectedNode.IsExpanded) { SelectedNode.IsExpanded = false; args.Item.Content = CollapseTemplate; diagram.UserHandles[0].Visible = false; if (SelectedNode == RootNode) { diagram.UserHandles[1].Visible = false; } } else { SelectedNode.IsExpanded = true; args.Item.Content = ExpandTemplate; diagram.UserHandles[0].Visible = true; if (SelectedNode == RootNode) { diagram.UserHandles[1].Visible = true; } } (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout(); diagram.Select(SelectedNode); } else if (args.Item.Name == "info") { ShowInfo(); } else { if (args.Item.Name == "Left") { CurrentHandle = UserHandlePosition.Left; AddAnnotation("Add Topic"); } else if (args.Item.Name == "Right") { CurrentHandle = UserHandlePosition.Right; AddAnnotation("Add Topic"); } } } }