내 질문이 이미 여기에있는 다른 모든 항목에 속하지 않는다고 생각합니다. 누군가가 나를 도와 줄 수 있기를 바랍니다.WPF TextBlock에 바인딩하면 대상이 즉시 업데이트되지 않습니다.
INotifyPropertyChnaged를 사용하여 TextBlock 바인딩을 설정했는데 제대로 작동합니다. 이 목표 제어 (TextBlock을)
내 코드의 아래로 빠른 실행을 업데이트 할 때 난 데 문제는
이제namespace XYZ
{
public partial class Loading : Window
{
StatusMessage msg = StatusMessage.GetInstance();
public loading()
{
InitializeComponent();
this.DataContext = msg;
}
private void LoadBackEndUsers()
{
msg.Status = "Loading Users";
//txtStatus.GetBindingExpression(TextBlock.TextProperty).UpdateTarget();
//lblLoading.Focus();
this.txtStatus.DataContext = msg;
beUsers = new BackendUsers(Database);
allBEUsers = beUsers.GetAllUsers();
}
private void LoadProducts()
{
msg.Status = "Loading Products";
//txtStatus.GetBindingExpression(TextBlock.TextProperty).UpdateTarget();
//lblLoading.Focus();
this.txtStatus.DataContext = msg;
products = new Product(Database);
allProducts = products.GetAllProducts();
}
private void Window_ContentRendered(object sender, EventArgs e)
{
LoadBackEndUsers();
LoadProducts();
}
}
}
내 문제 만이 방법 후에 나의 된 본체에 "로드 제품" LoadProducts()가 완료되었습니다. "사용자로드 중"은 표시되지 않으므로 모든 것이 완료된 후에 대상 만 업데이트됩니다.
어떻게 즉시 업데이트합니까? 주석 처리 된 비트는 업데이트를 강제하기 위해 여러 가지를 시도하는 것이 었습니다.
도움을 주시면 감사하겠습니다.
종류와 관련,
닐
하지 않음 msg를 변경할 때마다 this.txtStatus의 DataContext. – Scott
예, 실제로 테스트를 위해 업데이트를 시도하려고했습니다. – Neill