Answer the question
In order to leave comments, you need to log in
What is the best WPF component to use to implement the questionnaire (so that data binding is available)?
The task is to implement a questionnaire (representation of the user's page) for the VKontakte client.
There is an object containing information about the user. Is there a component in WPF for which you can create a View and a template so that the template takes data from the object using binding (for one object). I know how to implement this for a list of elements (in particular, for a List View, you can create a View, inside which there will be a template for how to display the contents of the collection objects).
Formulated as best I could
Answer the question
In order to leave comments, you need to log in
In WPF, any element can be given a DataContext that is passed to descendants.
Therefore, you can assign your questionnaire object to the DataContext property of any container: Canvas, Grid, StackPanel, and any other. And in all descendants, you can use a simple binding to the properties of this element. More or less like this:
<StackPanel DataContext="{x:Static local:MyClass.MyFirstAnketa}">
<TextBox Text="{Binding Name}" />
<TextBox Text="{Binding DateBirthday}" />
</StackPanel>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question