/// <summary> /// The expand collapse command execute. /// </summary> /// <param name="param"> /// The param. /// </param> private void ExpandCollapseCommandExecute(object param) { ExpandCollapseParameter parameter = new ExpandCollapseParameter { node = this, IsUpdateLayout = true }; ((this.Info as INodeInfo).Graph as IGraphInfo).Commands.ExpandCollapse.Execute(parameter); }
/// <summary> /// The execute expand collapse command. /// </summary> /// <param name="nodeVm"> /// The node vm. /// </param> internal void ExecuteExpandCollapseCommand(NodeVM nodeVm) { ExpandCollapseParameter parameter = new ExpandCollapseParameter { Node = nodeVm, IsUpdateLayout = true }; (this.Info as IGraphInfo).Commands.ExpandCollapse.Execute(parameter); }
/// <summary> /// The expand collapse command execute. /// </summary> /// <param name="param"> /// The param. /// </param> private void ExpandCollapseCommandExecute(object param) { BrainstormingNodeVM selectedNode = this.GetFirstSelectedItem(); // selectedNode.IsExpanded = selectedNode.IsExpanded ? false : true; // Updatebowtielayout(selectedNode.Type); ExpandCollapseParameter parameter = new ExpandCollapseParameter { Node = selectedNode, IsUpdateLayout = true }; (this.Info as IGraphInfo).Commands.ExpandCollapse.Execute(parameter); }
private void ExpandCollapseExecute(object obj) { OrganizationChartNodeVM node = ((this.SelectedItems as SelectorVM).Nodes as IEnumerable <object>).FirstOrDefault() as OrganizationChartNodeVM; if (node != null && (node.Info as INodeInfo) != null && (node.Info as INodeInfo).OutConnectors != null && (node.Info as INodeInfo).OutConnectors.Count() > 0) { ExpandCollapseParameter parameter = new ExpandCollapseParameter() { Node = node, }; (this.Info as IGraphInfo).Commands.ExpandCollapse.Execute(parameter); } }
private void ExpandCollapse_Click(object sender, RoutedEventArgs e) { var workingCollection = SelectedNodeCollection; var selectednode = (sfdiagram.SelectedItems as SelectorViewModel).SelectedItem; ItemInfo obj = null; if (selectednode != null && selectednode is NodeViewModel) { obj = (ItemInfo)(selectednode as NodeViewModel).Content; } if (obj != null) { workingCollection = new ObservableCollection <object> { NodeCollection.FirstOrDefault(j => j.Content == obj) }; } if (workingCollection.Count <= 0) { return; } foreach (NodeViewModel selectedItem in workingCollection) //Multiple Nodes can be selected and their child node can be collapsed/expanded at the same time { var expandCollapseParameter = new ExpandCollapseParameter { Node = selectedItem, IsUpdateLayout = true }; var graphInfo = sfdiagram.Info as IGraphInfo; var isExpanded = selectedItem.IsExpanded; // Without this get operation, the IsExpanded property of the node is not updated. graphInfo?.Commands.ExpandCollapse.Execute(expandCollapseParameter); var currentCardTree = new List <ItemInfo>(); var content = selectedItem.Content as ItemInfo; currentCardTree.AddRange(FindChildren(AllCards.ToList(), content)); var childNodes = NodeCollection.Where(j => currentCardTree.Contains(j.Content)).ToList(); var childConnectors = ConnectorsCollection.Where(j => childNodes.Contains(j.TargetNode)).ToList(); childConnectors.ForEach(j => j.IsVisible = !isExpanded); } }
/// <summary> /// The method to execute the expand and collapse operation. /// </summary> /// <param name="args">The parent node to be expanded or collapsed</param> private void OnExpandCollaseCommand(object args) { if (args is Node && (args as Node).DataContext is NodeViewModel) { ExpandCollapseParameter obj = new ExpandCollapseParameter(); obj.Node = (args as Node).DataContext as NodeViewModel; obj.IsUpdateLayout = true; IGraphInfo graphinfo = Info as IGraphInfo; if (((args as Node).DataContext as NodeViewModel).IsExpanded) { graphinfo.Commands.ExpandCollapse.Execute(obj); ((args as Node).DataContext as NodeViewModel).IsExpanded = false; ((args as Node).Content as ExpandandCollapseModel).IsExpand = State.Collapse; } else { graphinfo.Commands.ExpandCollapse.Execute(obj); ((args as Node).DataContext as NodeViewModel).IsExpanded = true; ((args as Node).Content as ExpandandCollapseModel).IsExpand = State.Expand; } } }
void sfdiagram_ItemTappedEvent(object sender, DiagramEventArgs args) { if (args.Item is INode) { if ((args.Item as OrgNodeViewModel).Content is Employee) { if (PreviousSelectedItem != null) { ((PreviousSelectedItem as OrgNodeViewModel).Content as Employee).IsFocus = NodeFocusState.Normal; } ChartViewModel.SelectedObject = (args.Item as OrgNodeViewModel); ((ChartViewModel.SelectedObject as OrgNodeViewModel).Content as Employee).IsFocus = NodeFocusState.Focused; PreviousSelectedItem = ChartViewModel.SelectedObject; } HidePopup((args.Item as OrgNodeViewModel)); } if (args.Item is OrgNodeViewModel) { ExpandCollapseParameter obj = new ExpandCollapseParameter(); obj.node = (args.Item as INode); obj.IsUpdateLayout = true; IGraphInfo graphinfo = sfdiagram.Info as IGraphInfo; ChartViewModel.SelectedObject = (args.Item as OrgNodeViewModel); if (((args.Item as OrgNodeViewModel).Content as Employee).IsExpand == State.Expand) { ((args.Item as OrgNodeViewModel).Content as Employee).IsExpand = State.Collapse; graphinfo.Commands.ExpandCollapse.Execute(obj); } else if (((args.Item as OrgNodeViewModel).Content as Employee).IsExpand == State.Collapse) { ((args.Item as OrgNodeViewModel).Content as Employee).IsExpand = State.Expand; graphinfo.Commands.ExpandCollapse.Execute(obj); } CheckSearch((sender as OrgChartDiagram)); } }
/// <summary> /// The method to execute the expand and collapse operation. /// </summary> /// <param name="args">The parent node to be expanded or collapsed</param> private void OnExpandCollaseCommand(object args) { if (args is Node && (args as Node).DataContext is NodeViewModel) { ExpandCollapseParameter obj = new ExpandCollapseParameter(); obj.Node = (args as Node).DataContext as NodeViewModel; obj.IsUpdateLayout = true; obj.IsEnableAnimation = true; IGraphInfo graphinfo = Info as IGraphInfo; if (((args as Node).DataContext as NodeViewModel).IsExpanded) { graphinfo.Commands.ExpandCollapse.Execute(obj); ((args as Node).DataContext as NodeViewModel).IsExpanded = false; ((args as Node).Content as MindmapDataItem).IsExpand = State.Collapse; } else { graphinfo.Commands.ExpandCollapse.Execute(obj); ((args as Node).DataContext as NodeViewModel).IsExpanded = true; ((args as Node).Content as MindmapDataItem).IsExpand = State.Expand; } (((this.LayoutManager.Layout as MindMapTreeLayout).LayoutRoot as INode).Info as INodeInfo).BringIntoCenter(); } }