Silverlight – How to bind TreeViewItem.isexpanded data to node data objects

I have a class like hierarchical data

public class MyNode 
{
public string Name {get; set;}
public bool IsExpanded {get; set;}
public List Nodes {get; set;}
}

I can Define a HierarchicalDataTemplate to bind the MyNode class to TreeView.







The question is how to bind the IsExpanded property data of TreeViewItem to the corresponding MyNode.IsExpanded property, so I can keep this information.

p>

Thank you in advance,
Lex

I’m not sure if this applies In Silverlight, but in WPF, you can use styles to bind to IsExpanded:










I have a class like hierarchical data

< p>

public class MyNode 
{
public string Name {get; set;}
public bool IsExpanded {get; set;}
public List< MyNode> Nodes {get; set;}
}

I can define a HierarchicalDataTemplate to bind the MyNode class to the TreeView.

< sdk:TreeView ItemsSource="{Binding RootNodes}">





< /pre>

The question is how to bind the IsExpanded property of TreeViewItem to the corresponding MyNode.IsExpanded property, so I can keep this information.

Thank you in advance,
Lex

p>

I'm not sure if this applies to Silverlight, but in WPF, you can bind to IsExpanded using styles:

< /p>










WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4039 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.