I'm new to WPF for Windows application development, just wanted to put that out there first. I'm using Visual Studio 2010 and .NET Framework 4.0.
I'm working on a rather simple administration tool. For simplicity sake lets say I'm working with Employee data. I've created a little UserControl called UserDetail that has all the fields that relate to the Employee class.
What is the simplest way to bind the input controls on my UserDetail? This could have a blank screen when creating a new instance, or existing values if editing an existing instance.
I tried the following in the constructor:
DataContext = _employee;
And I bound a control like this in the XAML:
<TextBox Name="txtFirstName" Text="{Binding FirstName}"/>
This works, but it doesn't seem like the correct way to do it. This seems like a simple example, but I haven't found anything helpful yet.
Any suggestions or links to an tutorial for this sort of simple binding?