Hi, I'm completely new to databinding in WPF, and I'm trying to bind an object property to a textbox. My object is
public class TestObj
{
private m_Limit;
public string Limit
{
get
{
return m_Limit;
}
set
{
m_Limit = value;
}
}
My XAML looks like
<Window x:Class="NECSHarness2.UpdateJobParameters"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tools="clr-namespace:ManagementObjects;assembly=Core"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="Update Job Parameters" Height="320" Width="460">
<Grid>
<TextBox Text ="{Binding Path = Limit, Mode = TwoWay}" Height="20" HorizontalAlignment="Right" Margin="0,48,29,0" Name="textBox3" VerticalAlignment="Top" Width="161" />
</Grid>
Now, obviously I'm not setting the source anywhere, and I'm very confused. I got this to work with a listview, but now I'm stumped. Thanks for any help.