Tuesday, July 28, 2009

Dock panel in WPF and Databinding

<DockPanel >
<TextBox DockPanel.Dock="Top" Text="TOP"/>
<TextBox DockPanel.Dock="Right" Text="Right"></TextBox>
&l;tTextBox DockPanel.Dock="Bottom" Text="{Binding Path=Name}"/>
</DockPanel>


-----------------------------------
class person
{
string name = "Admin";
public string Name
{
get { return name; }
set { name = value; }
}
}
--------------------------------------
public Window1()
{
InitializeComponent();
person p = new person();
this.DataContext = p;
}
--------------------------------------

No comments: