R
RDA
Hey all, I'm having a tough time conducting a simple databinding
procedure in XBAP. Here's my code:
<Page x:Class="WPF_IBS.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1">
<TextBox x:Name="personNameTextBox" Text="{Binding Path=Name}" />
</Page>
Here's the namespace:
namespace WPF_IBS
{
class Person
{
string name = "No Name";
public string Name
{
get { return name; }
set { name = value; }
}
}
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
Person person = new Person();
this.DataContext = person;
}
}
}
This is the entirety of my code. I can not get this simple process to
work. What am I doing wrong??
procedure in XBAP. Here's my code:
<Page x:Class="WPF_IBS.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1">
<TextBox x:Name="personNameTextBox" Text="{Binding Path=Name}" />
</Page>
Here's the namespace:
namespace WPF_IBS
{
class Person
{
string name = "No Name";
public string Name
{
get { return name; }
set { name = value; }
}
}
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
Person person = new Person();
this.DataContext = person;
}
}
}
This is the entirety of my code. I can not get this simple process to
work. What am I doing wrong??