-1
用Name2的值绑定文本框不起作用。代码是正确的,并在一个简单的WPF应用程序中工作。有没有其他方法可以在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));
}
}
}
您是否在Visual Studio的“调试输出”窗口中看到任何绑定错误? – slfan
@slfan不,我不... –
一切看起来都不错。但是你需要TextBox.BindingGroup用于什么?是否有可能以某种方式清除绑定? – slfan