My scenario is:
I have a WPF Window with 3 data-bound text boxes
SettingsUI : Window
<Grid Name="SettingsUIGrid1">
<TextBox Text="{Binding Path =val1}" ....
<TextBox Text="{Binding Path =val2}" ....
<TextBox Text="{Binding Path =val3}" ....
</Grid>
In the constructor I do this:
SettingsUIGrid1.DataContext = coll[0]; // collection first value
When the Cancel button is clicked, I close my window:
private void btnCancel_Click(object sender, RoutedEventArgs e) {
Close();
}
When I click the Show button, is shows values from the DB in text boxes, if user changes a text box value, and reloads the window the new value is displayed not the old one. Can someone suggest what to do to reload the values again and clear the in memory object?