I have the following DataTemplate
in my App.xaml file:
<DataTemplate x:Key="OneSettingsEntryTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource StandardTextBlocksStyle}"
Text="{Binding Text}" />
<TextBox Style="{StaticResource DefaultTextBoxesStyle}"
Text="{Binding Content}" />
</StackPanel>
</DataTemplate>
and the following class which contains both Binding properties:
public class InputText
{
private string Text { get; set; }
private string Content { get; set; }
public InputText(string text, string content)
{
Text = text;
Content = content;
}
}
The App.xaml file tells me Cannot resolve symbol text.
How can I tell the Data Template, which class
respectively source
it should use, so that Binding works?
Alright, I found a solution that works for me. I knew I needed the
DataType
property but didn't know how to reference it, to another class. It looks likex:Type
was what I missed:If there are better alternatives, please share it.