Example #1
0
        public void OnSelect(NodeSelectEventArgs args)
        {
            var selectedId = args.NodeData.Id;

            SelectedTagonomyNode = TagonomyNav.FirstOrDefault(it => it.Id == selectedId)?.Node;
            SelectedItem         = PreCreateView(null, SelectedTagonomyNode);
        }
Example #2
0
        public TagonomyNodeViewItem PreCreateView(PathNodeElement.Leg leg, TagonomyNode node)
        {
            var view = new TagonomyNodeViewItem(node);

            view.Leg = leg;

            var tagonomy = this.Source;

            if (leg == null || leg.Type != PathNodeElement.Leg.Types.Shortcut)             // Shortcuts show no children.
            {
                foreach (var childNodeLeg in node.GetDirectChildrenLegs())
                {
                    var childNode = tagonomy.GetNode(childNodeLeg.TargetNodeId);
                    if (childNode == null)
                    {
                        continue;
                    }

                    TagonomyNodeViewItem childView = PreCreateView(childNodeLeg, childNode);
                    view.AddChild(childView);
                }
            }

            return(view);
        }
        public List <TagonomyNodeViewItem> AllParentViews()
        {
            List <TagonomyNodeViewItem> result     = new List <TagonomyNodeViewItem>();
            TagonomyNodeViewItem        parentView = this.ParentView;

            while (parentView != null)
            {
                result.Add(parentView);
                parentView = parentView.ParentView;
            }

            return(result);
        }
Example #4
0
        public async Task Init()
        {
            if (HyperStore == null)
            {
                await OnToastMessage.InvokeAsync(new ToastMessage("Missing Hyper Store", ToastMessageType.Error));

                return;
            }

            await PopulateData();

            SelectedTagonomyNode = RootView?.Node;
            SelectedItem         = PreCreateView(null, SelectedTagonomyNode);

            IsLoadedData = true;
        }
Example #5
0
        private TagonomyNodeNavigationItem GetTagonomyNav(TagonomyNodeViewItem item)
        {
            if (item == null)
            {
                throw new Exception("Missing tagonomy node data");
            }

            return(new TagonomyNodeNavigationItem
            {
                Id = item.Id,
                Name = item.Name,
                Expanded = true,
                ParentId = item.ParentView?.Id,
                HasSubFolders = item.Children.Count > 0,
                Node = item.Node
            });
        }
Example #6
0
        private void PopulateNavigation(TagonomyNodeViewItem item)
        {
            var view = GetTagonomyNav(item);

            TagonomyNav.Add(view);

            if (item.Children != null)
            {
                foreach (var childItem in item.Children)
                {
                    if (childItem.Children != null)
                    {
                        PopulateNavigation(childItem);
                    }
                }
            }
        }
 public void RemoveChild(TagonomyNodeViewItem view)
 {
     this.Children.Remove(view);
     view.ParentView = null;
 }
 public void AddChild(TagonomyNodeViewItem view)
 {
     this.Children.Add(view);
     view.ParentView = this;
 }