private void Diagram_Loaded(object sender) { diagram.EnableDrag = false; diagram.ShowSelectorHandle(false, SelectorPosition.SourcePoint); diagram.ShowSelectorHandle(false, SelectorPosition.TargetPoint); diagram.ShowSelectorHandle(false, SelectorPosition.Rotator); diagram.ShowSelectorHandle(false, SelectorPosition.TopLeft); diagram.ShowSelectorHandle(false, SelectorPosition.TopRight); diagram.ShowSelectorHandle(false, SelectorPosition.MiddleLeft); diagram.ShowSelectorHandle(false, SelectorPosition.MiddleRight); diagram.ShowSelectorHandle(false, SelectorPosition.BottomCenter); diagram.ShowSelectorHandle(false, SelectorPosition.BottomLeft); diagram.ShowSelectorHandle(false, SelectorPosition.BottomRight); diagram.ShowSelectorHandle(false, SelectorPosition.TopCenter); diagram.LayoutManager = new LayoutManager() { Layout = new MindMapLayout() { MindMapOrientation = Syncfusion.SfDiagram.iOS.Orientation.Horizontal, HorizontalSpacing = 70, } }; diagram.LayoutManager.Layout.UpdateLayout(); diagram.Select(RootNode); diagram.BringToView(RootNode); }
private void Diagram_Loaded(object sender) { diagram.EnableDrag = false; diagram.ShowSelectorHandle(false, SelectorPosition.SourcePoint); diagram.ShowSelectorHandle(false, SelectorPosition.TargetPoint); diagram.ShowSelectorHandle(false, SelectorPosition.Rotator); diagram.ShowSelectorHandle(false, SelectorPosition.TopLeft); diagram.ShowSelectorHandle(false, SelectorPosition.TopRight); diagram.ShowSelectorHandle(false, SelectorPosition.MiddleLeft); diagram.ShowSelectorHandle(false, SelectorPosition.MiddleRight); diagram.ShowSelectorHandle(false, SelectorPosition.BottomCenter); diagram.ShowSelectorHandle(false, SelectorPosition.BottomLeft); diagram.ShowSelectorHandle(false, SelectorPosition.BottomRight); diagram.ShowSelectorHandle(false, SelectorPosition.TopCenter); diagram.LayoutManager = new LayoutManager() { Layout = new MindMapLayout() { MindMapOrientation = Syncfusion.SfDiagram.Android.Orientation.Horizontal, HorizontalSpacing = 70, } }; (diagram.LayoutManager.Layout as MindMapLayout).HorizontalSpacing = 70 * MainActivity.Factor; if (!(diagram.LayoutManager.Layout as MindMapLayout).EnableFreeForm) { diagram.LayoutManager.Layout.UpdateLayout(); } SelectedNode = RootNode; diagram.Select(RootNode); diagram.BringToView(RootNode); UpdateTheme(); }
internal void ShowPopUp(string positive, string negative) { alertBuilder.SetTitle("Enter Text"); editText.Text = _inputstring; editText.FocusableInTouchMode = true; editText.RequestFocus(); editText.SetBackgroundColor(Color.WhiteSmoke); editText.SetTextColor(Color.Black); alertBuilder.SetView(editText); alertBuilder.SetCancelable(false); alertBuilder.SetPositiveButton(positive, (senderAlert, args) => { diagram.Alpha = 1; diagram.PageSettings.BackgroundColor = Color.White; if (editText.Text == null) { editText.Text = ""; } var node = new Node(diagram.Context); if (CurrentHandle == UserHandlePosition.Left) { node.OffsetX = SelectedNode.OffsetX - SelectedNode.Width - 100; node.OffsetY = SelectedNode.OffsetY; } else if (CurrentHandle == UserHandlePosition.Right) { node.OffsetX = SelectedNode.OffsetX + SelectedNode.Width + 100; node.OffsetY = SelectedNode.OffsetY; } node.Width = SelectedNode.Width; node.Height = SelectedNode.Height; node.ShapeType = ShapeType.RoundedRectangle; node.Style.StrokeWidth = 3; if (SelectedNode == RootNode) { index = rnd.Next(5); node.Style.Brush = new SolidBrush(FColor[index]); node.Style.StrokeBrush = new SolidBrush(SColor[index]); } else { node.Style = SelectedNode.Style; } node.Annotations.Add(new Annotation() { Content = editText.Text, FontSize = 14 * MainActivity.Factor, TextBrush = new SolidBrush(Color.Black) }); diagram.AddNode(node); var c1 = new Connector(diagram.Context); c1.SourceNode = SelectedNode; c1.TargetNode = node; //c1.Style.StrokeBrush = node.Style.StrokeBrush; //c1.Style.StrokeWidth = 3; //c1.TargetDecoratorStyle.Fill = (node.Style.StrokeBrush as SolidBrush).FillColor; //c1.TargetDecoratorStyle.StrokeColor = (c1.TargetNode.Style.StrokeBrush as SolidBrush).FillColor; //c1.SegmentType = SegmentType.CurveSegment; //c1.Style.StrokeStyle = StrokeStyle.Dashed; diagram.AddConnector(c1); if (CurrentHandle == UserHandlePosition.Left) { if (!(diagram.LayoutManager.Layout as MindMapLayout).EnableFreeForm) { (diagram.LayoutManager.Layout as MindMapLayout).UpdateLeftOrTop(); } } else if (CurrentHandle == UserHandlePosition.Right) { if (!(diagram.LayoutManager.Layout as MindMapLayout).EnableFreeForm) { (diagram.LayoutManager.Layout as MindMapLayout).UpdateRightOrBottom(); } } m_mindmap.SelectedNode = node; m_mindmap.UpdateHandle(); diagram.Select(node); diagram.BringToView(node); m_mindmap.UpdateTheme(); }); alertBuilder.SetNegativeButton(negative, (senderAlert, args) => { alertBuilder.SetCancelable(true); }); alertBuilder.Show(); }
private void Diagram_Loaded(object sender) { diagram.BringToView(diagram.Nodes[0]); }