Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to bind ItemsControl to a property in a 3rd level nested class.?

$
0
0

Hi,

Its a novice question... but I am stuck.

I have a following classes

 public class Main: IList<S>, INotifyCollectionChanged
    {
        private List<S> _s= new List<S>();

    }

 public class S: INotifyPropertyChanged
    {
        public TP _tp;
        public IP _ip  ;

}

publicclassIP:INotifyPropertyChanged{

       public string _iPath { get; set; }

}

publicclassTP:INotifyPropertyChanged{

       public string _tPath { get; set; }

}

Now I have a itemscontrol and how to Bind with it. How to display _iPath  and _tPath   ?

   <ItemsControl x:Name="xItemsControl"
                              ItemsSource="{Binding Mode=OneWay}"
                              Visibility="Visible"
                          >
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid x:Name="xGrid" Height="Auto">
                                <Border Background="Orange">
                                    <TextBlock
                            x:Name="xTextBlock"
                            Text="{Binding ???


Any Clues ?

Regards

   



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>