Skip to content

Instantly share code, notes, and snippets.

Created October 7, 2013 14:21
Show Gist options
  • Save anonymous/6db7eb3ec374496bcfc2 to your computer and use it in GitHub Desktop.
Save anonymous/6db7eb3ec374496bcfc2 to your computer and use it in GitHub Desktop.
/// <summary>
/// This function will result in holding what tree view item (childItem) to delete from the Children of another tree view (baseItem)
/// </summary>
/// <param name="baseItem">The "root" TV item</param>
/// <param name="childItem">The item to remove from the root's children</param>
/// <returns></returns>
private void DeleteItem(ref TVBaseItem baseItem, ref TVBaseItem childItem)
{
TVBaseItem parentToRemoveChildren = null;
while (!(baseItem is WorkspaceViewModel) && baseItem.Children.Count <= 1)
{
parentToRemoveChildren = baseItem;
baseItem = baseItem.Parent;
}
childItem = parentToRemoveChildren;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment