public ToggleIsExpandedCommand(BrowserItem i) { this.item = i; }
public BrowserInternalElement(string name, BrowserItem parent) { this._name = name; this.Parent = parent; this.OldParent = null; }
public void Execute(object parameters) { if (item is PackageManagerSearchElement) { item.IsExpanded = !item.IsExpanded; return; } if (item is SearchElementBase) { ((SearchElementBase)item).Execute(); return; } var endState = !item.IsExpanded; if (item is BrowserInternalElement) { BrowserInternalElement element = (BrowserInternalElement)item; foreach (var ele in element.Siblings) { ele.IsExpanded = false; } //Walk down the tree expanding anything nested one layer deep //this can be removed when we have the hierachy implemented properly if (element.Items.Count == 1) { BrowserItem subElement = element.Items[0]; while (subElement.Items.Count == 1) { subElement.IsExpanded = true; subElement = subElement.Items[0]; } subElement.IsExpanded = true; } } if (item is BrowserRootElement) { BrowserRootElement element = (BrowserRootElement)item; foreach (var ele in element.Siblings) { ele.IsExpanded = false; } //Walk down the tree expanding anything nested one layer deep //this can be removed when we have the hierachy implemented properly if (element.Items.Count == 1) { BrowserItem subElement = element.Items[0]; while (subElement.Items.Count == 1) { subElement.IsExpanded = true; subElement = subElement.Items[0]; } subElement.IsExpanded = true; } } item.IsExpanded = endState; }
public BrowserInternalElement(string name, BrowserItem parent) { this._name = name; this.Parent = parent; this.OldParent = null; }
public ToggleIsExpandedCommand(BrowserItem i) { this.item = i; }