B
B
bagos2015-03-05 12:10:28
WPF
bagos, 2015-03-05 12:10:28

How to set a Binding to a class field contained in another class?

Available List<A>,
on the form listbox ItemsSource=..List<A>
for it is created

<ListBox.ItemTemplate>
                                <DataTemplate>

...
how to access Name, Size(from Properties for specific A?) in a text block say?
public class Properties
    {
        public string Name { get; set; }
        public string Size { get; set; }
    }
    class A
    {
        public Properties prop;
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bagos, 2015-03-05
@bagos

Yes, it turns out I didn’t see it, get; set from public Properties prop; is absent

V
vitvov, 2015-03-05
@vitvov

If I understand the question correctly, then you need to write like this: And
the classes must implement the interfacePropertiesAINotifyPropertyChanged

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question