private static TreeViewItemInfo GetParentLastChild(TreeViewItemInfo info)
        {
            var targetParent = info.Parent;
            var last         = targetParent?.Children.LastOrDefault();

            return(last);
        }
        void windowTree__SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeViewItemInfo info = e.NewValue as TreeViewItemInfo;

            if (info == null)
            {
                return;
            }
            LoadPage(info.Id);
        }
        private void treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            try
            {
                if (_SelectedItemChanged != null)
                {
                    TreeViewItemInfo info = e.NewValue as TreeViewItemInfo;
                    if (info == null)
                    {
                        return;
                    }

                    int index = pageStageList.FindIndex(p => p.PageId == info.Id);
                    TxtCurrent.Text = (index + 1).ToString();
                    IsNextUp();
                    _SelectedItemChanged(sender, e);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private static void ResetSeparator(TreeViewItemInfo info)
 {
     info.Background = Brushes.Transparent;
     info.BeforeSeparatorVisibility = Visibility.Hidden;
     info.AfterSeparatorVisibility  = Visibility.Hidden;
 }
 private static void RemoveCurrentItem(TreeViewItemInfo sourceItemParent, TreeViewItemInfo sourceItem)
 {
     sourceItemParent.RemoveChildren(sourceItem);
 }