public PackageSearchFilterTabs()
        {
            root = Resources.GetTemplate("PackageSearchFilterTabs.uxml");
            Add(root);
            root.StretchToParentSize();

            LocalButton.AddManipulator(new Clickable(() => SetFilter(PackageFilter.Local)));
            AllButton.AddManipulator(new Clickable(() => SetFilter(PackageFilter.All)));

            OnFilterChanged();
            PackageCollection.Instance.OnFilterChanged += OnFilterChanged;
        }
        public PackageSearchFilterTabs()
        {
            root = Resources.Load <VisualTreeAsset>("Templates/PackageSearchFilterTabs").CloneTree(null);
            Add(root);
            root.StretchToParentSize();

            LocalButton.AddManipulator(new Clickable(() => SetFilter(PackageFilter.Local)));
            AllButton.AddManipulator(new Clickable(() => SetFilter(PackageFilter.All)));

            OnFilterChanged();
            PackageCollection.Instance.OnFilterChanged += OnFilterChanged;
        }
        void ReleaseDesignerOutlets()
        {
            if (AllButton != null)
            {
                AllButton.Dispose();
                AllButton = null;
            }

            if (HighlightsButton != null)
            {
                HighlightsButton.Dispose();
                HighlightsButton = null;
            }

            if (NotesButton != null)
            {
                NotesButton.Dispose();
                NotesButton = null;
            }

            if (TagFilterButton != null)
            {
                TagFilterButton.Dispose();
                TagFilterButton = null;
            }

            if (TagFilterPopBtn != null)
            {
                TagFilterPopBtn.Dispose();
                TagFilterPopBtn = null;
            }

            if (InfoView != null)
            {
                InfoView.Dispose();
                InfoView = null;
            }

            if (InfoLabelTF != null)
            {
                InfoLabelTF.Dispose();
                InfoLabelTF = null;
            }

            if (AnnotationTableView != null)
            {
                AnnotationTableView.Dispose();
                AnnotationTableView = null;
            }
        }
        private void OnFilterChanged(PackageFilter filter = PackageFilter.None)
        {
            if (filter == PackageFilter.None)
            {
                filter = PackageCollection.Instance.Filter;
            }

            CurrentFilter = filter;

            if (filter == PackageFilter.All)
            {
                AllButton.AddToClassList(SelectedClassName);
                LocalButton.RemoveFromClassList(SelectedClassName);
            }
            else if (filter == PackageFilter.Local)
            {
                LocalButton.AddToClassList(SelectedClassName);
                AllButton.RemoveFromClassList(SelectedClassName);
            }

            root.SetEnabled(true);
        }
        void ReleaseDesignerOutlets()
        {
            if (AllButton != null)
            {
                AllButton.Dispose();
                AllButton = null;
            }

            if (AnnotationCustomView != null)
            {
                AnnotationCustomView.Dispose();
                AnnotationCustomView = null;
            }

            if (AnnotationTableView != null)
            {
                AnnotationTableView.Dispose();
                AnnotationTableView = null;
            }

            if (FunctionButtonView != null)
            {
                FunctionButtonView.Dispose();
                FunctionButtonView = null;
            }

            if (HighlightsButton != null)
            {
                HighlightsButton.Dispose();
                HighlightsButton = null;
            }

            if (NotesButton != null)
            {
                NotesButton.Dispose();
                NotesButton = null;
            }

            if (OrphansButton != null)
            {
                OrphansButton.Dispose();
                OrphansButton = null;
            }

            if (TagsTableView != null)
            {
                TagsTableView.Dispose();
                TagsTableView = null;
            }

            if (TagsView != null)
            {
                TagsView.Dispose();
                TagsView = null;
            }

            if (InfoLabelTF != null)
            {
                InfoLabelTF.Dispose();
                InfoLabelTF = null;
            }
        }