views:

28

answers:

1

I have just converted my project to wpf 4 , In my previous version I have used the dialog Result set to true when the save but of a showDialog is click but now I don't get the true value of the dialogResult Property . is there any reason or I need to change the code

 wndWindow childWindow= new wndWindow();
            childWindow.ShowInTaskbar = false;
            childWindow.Owner = this;
            childWindow.ShowDialog();
            if (childWindow.DialogResult == true)
            {     
            }

above is my code and I have just set DialogResult=true in save but of the wndWindow Save. but when I check for the DialogResult in if condition it is false why is so

A: 

hi, you have to set DialogResult=true by your self, otherwise its never true.

look at this to understand the wpf Dialog better.

blindmeis
Yes I did but that was error from my side as I have set the dialog result again on the closing of the form.
Asim Sajjad