I am new to WPF, so I thought it was easy. I have a form with a list and a button. In the click handler for the button, I am doing iteratively something that generates the lines that I want to put into the list when I receive them. Xaml for the list looks like
<ListBox Height="87" Margin="12,0,12,10" Name="lbxProgress" VerticalAlignment="Bottom"> <ListBox.BindingGroup> <BindingGroup Name="{x:Null}" NotifyOnValidationError="False" /> </ListBox.BindingGroup> </ListBox>
and the click handler is similar to
private void btn_Click(object sender, RoutedEventArgs e) { List<String> lstrFiles= new List<String>(System.IO.Directory.GetFiles ("C:\\temp", "*.tmp"); foreach(string strFile in lstrFiles) lbxProgress.Items.Add(strFile); }
Pretty simple. Since my real operation is lengthy, I want the list to be updated, as I do each - how do I get a window for dynamic updating every time I add it?
source share