Esempio n. 1
0
        private void btnFilterValue_Click(object sender, RoutedEventArgs e)
        {
            string       name     = txtFilterValue.Text;
            TreeViewItem newChild = new TreeViewItem();

            newChild.Header = name;
            if (treeView1.SelectedItem == null)
            {
                return;
            }
            var index = treeView1.Items.IndexOf(treeView1.SelectedItem);

            if (index == -1)
            {
                return;
            }
            var item = (TreeViewItem)treeView1.Items[index];//[0];

            if (item.Header is MyTreeViewItem)
            {
                _filterProvider.AddFilterValue(name, item.Header as MyTreeViewItem);
                refreshTreeView();
            }
        }