public static bool WalkTreeViewItem(TreeView tree, TreeViewItem treeViewItem, object selectedValue)
        {
            if (treeViewItem.DataContext == selectedValue)
            {
                treeViewItem.SetValue(TreeViewItem.IsSelectedProperty, true);
                treeViewItem.Focus();
                treeViewItem.BringIntoView();
                return true;
            }
            var itemsHostProperty = treeViewItem.GetType().GetProperty("ItemsHost", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            var itemsHost = itemsHostProperty?.GetValue(treeViewItem, null) as Panel;

            if (itemsHost == null)
            {
                return false;
            }

            foreach (var item in itemsHost.Children.OfType<TreeViewItem>())
            {
                var oldExpanded = item.IsExpanded;
                item.IsExpanded = true;
                item.UpdateLayout();
                if (WalkTreeViewItem(tree, item, selectedValue))
                {
                    return true;
                }
                item.IsExpanded = oldExpanded;
            }

            return false;
        }