I have a small pop up window coming up when user selects a record from the main grid. I would like to keep this window open after user has made the selection until he or she clicks cancel. Here is my little code. If I comment out this.close() method then control never returns back to execute rest of the code.
private void ClickSubmit(object sender, RoutedEventArgs e)
{
try
{
IsCancelled = false;
// Figure out to keep this little window open after clicking submit !!
this.Close();
return;
}
catch (Exception ex)
{
ex.ToString();
}
}
private void ClickCancel(object sender, RoutedEventArgs e)
{
try
{
Trace.WriteLine("Popup exit !");
IsCancelled = true;
this.Close();
return;
}
catch (Exception ex)
{
ex.ToString();
}
}
OrdRec or = lvOrders.SelectedItem as OrdRec;
PxQtyPopup pop = new PxQtyPopup(or);
//pop.ShowDialog();
pop.Show();
if (!pop.IsCancelled) // check whether price/qty change submitted or popup window was cancelled
(DCtxt as OrdViewModel).ModifyOrder(or, int.Parse(pop.Qty), decimal.Parse(pop.Px));
