/// <summary>
        /// 一级子节点右键菜单点击,新增子二级节点
        /// </summary>
        private void TreeViewMenuItemAddChild_Click(object sender, RoutedEventArgs e)
        {
            //获取到对应的TreeViewItem
            var node = ((TreeView)((System.Windows.Controls.Primitives.Popup)((ContextMenu)((MenuItem)sender).Parent).Parent).PlacementTarget).SelectedItem as TreeViewItem;

            if (node == null)
            {
                return;
            }

            UserTreeViewItem2 tviTmp = new UserTreeViewItem2();
            //tviTmp.SetValue(TreeViewItem.StyleProperty, Application.Current.Resources["myTreeViewItemStyle2"]);
            int lastTag = -1;

            if (node.Items.Count != 0)
            {
                lastTag = ((UserTreeViewItem2)node.Items[node.Items.Count - 1]).TreeViewItemEndBit;
                if (lastTag >= 7)
                {
                    return;
                }
            }

            tviTmp.Tag = lastTag + 1;



            tviTmp.PreviewMouseRightButtonDown += TreeViewItem_PreviewMouseRightButtonDown;
            node.Items.Add(tviTmp);;
        }
            //结束位
            private static void OnTreeViewItemEndBitChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            {
                int b = Convert.ToInt32(e.NewValue);

                if (b < 0 || b > 7)
                {
                    return;
                }

                UserTreeViewItem2 gauge = d as UserTreeViewItem2;

                (gauge.feCbEndBit).Text = e.NewValue.ToString();

                //长度
                gauge.SetValue(TreeViewItemBitLengthProperty, gauge.TreeViewItemEndBit - gauge.TreeViewItemStartBit);
            }
            //实际值
            private static void OnTreeViewItemRealValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            {
                UserTreeViewItem2 gauge = d as UserTreeViewItem2;

                (gauge.feTbRealValue).Text = e.NewValue.ToString();
            }