WPF TreeView MultiBinding RRS feed

  • Вопрос

  • Good Day

    I've a trouble with TreeView Multibinding in WPF.


    I have some classes and TreeView Control


    public class Company{
        public string Title {get; set;}
        public string Country {get; set;}
        public List<Company> ChildCompanies {get; set;}
        public Company ParentCompany {get; set;}
        public List<Project> Projects {get; set;}

    public class Project{
        public string Title {get; set;}
        public int Price {get; set;}
        public Company ParentCompany {get; set;}


    And Something like this:


            <HierarhicalDataTemplate DataType="{x:Type local:Company}">
                    <MultiBinding Converter="">  !!!!!!!!!!!!!!!!!!!!!!!!!
                        <Binding Path="ChildCompanies"/>
                        <Binding Path="Projects"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Title}"/>
        <TreeView Name="CorporationTree"></TreeView>


    I need to see in treeview control the elements of two classes like in Windows explorer, where:

    Companies it's spmething like folders with subfolders possibility

    and Projects it's something like Files in current Folders.

    I don't understand how to implement this multibinding and i don't understand what is converter and how it works.


    Please help to solve this problem.

    23 октября 2010 г. 16:38