Binding a textbox with value of Name2 doesn't work. Code is correct and works in a simple WPF application. Is there any other way to bind in devexpress?
<TextBox Height="20" TextWrapping="Wrap" Text="{Binding Path=Name2}" VerticalAlignment="Top" Margin="429,27,159,0" AcceptsReturn="True">
public partial class EntitiesView : UserControl, INotifyPropertyChanged
{
private string _name2;
public string Name2
{
get { return _name2; }
set
{
_name2 = value;
RaisePropertyChanged("Name2");
}
}
public EntitiesView()
{
Name2 = "abcdefffffffffffff";
DataContext = this;
InitializeComponent();
}
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}