private void mIODTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { TreeViewItem aSelectedNode = this.mIODTree.SelectedItem as TreeViewItem; if (aSelectedNode == null) { return; } // Clear old content this.mDICONDETagTree.Items.Clear(); mGrid.RowDefinitions.First().Height = new GridLength(0); mGrid.RowDefinitions.Last().Height = new GridLength(0); IOD anIOD = aSelectedNode.Tag as IOD; if (anIOD == null) { return; } // Set the FileName as root node string[] split = anIOD.FileName.Split(new Char[] { '\\' }); string aFileName = split[split.Length - 1]; TreeViewItem aRootNode = new TreeViewItem() { Header = string.Format("File: {0}", aFileName) }; this.mDICONDETagTree.Items.Add(aRootNode); // Expand the root node aRootNode.IsExpanded = true; // Add all DICONDE attributes to the tree foreach (XElement xe in anIOD.XDocument.Descendants("DataSet").First().Elements("DataElement")) { AddDICONDEAttributeToTree(aRootNode, xe); } // In case the IOD does have a processable pixel data, the ImageFlow button, the volume buttons and the bitmap is shown. // Otherwise, only the DICONDE attributes are shown and the first and last grid row is hided. }
public void Add(IOD theIODInfo) { myIODRepository.Add(theIODInfo); }