This is a migrated thread and some comments may be shown as answers.

Show Dialog Window lost

8 Answers 1007 Views
Window
This is a migrated thread and some comments may be shown as answers.
Seycan
Top achievements
Rank 1
Seycan asked on 31 Mar 2014, 08:18 AM
I have rad windows ,one of them is mainwindow  ,another of them is show dialog window  and  i have problem about, for example .both of them opened and  when i would open different program after that  trying to open again this program window of show dialog  stay back side  and i  and i cant be usefull for me  in a result i want show dialog window is top of main window also i tried to use  named BringIntoView and BringIntofront methods but they didnt work. i need your helps. maybe you can send sample about it to me,

8 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 31 Mar 2014, 02:27 PM
Hi Seycan,

In order to achieve the required you will need to set the Owner property of the dialog RadWindow to be the MainWindow. Please check the following code snippet:

var wind = new RadWindow();
wind.Height = 300;
wind.Width = 200;
wind.Owner = Application.Current.MainWindow;
wind.ShowDialog();

Hope this helps.

Regards,
Kalin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Seycan
Top achievements
Rank 1
answered on 31 Mar 2014, 03:02 PM
thanks but  i  forgot to say you , i use wpf mvvm so i need to owner dependecy property sample for using bind to window
0
Kalin
Telerik team
answered on 01 Apr 2014, 08:29 AM
Hello Seycan,

You will need to set the owner at the same place where you are calling the ShowDialog() method of RadWindow (just before to show it). So you doesn't to bind it anyhow as you are showing it probably in the code behind.

Hope this helps. If you are still facing any issues, I'll ask you to share some sample code which demonstrates the exact scenario.

Regards,
Kalin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Seycan
Top achievements
Rank 1
answered on 01 Apr 2014, 08:49 AM
Yeah you are right bu  i use it different  way , i made  named IDialog interface and it has only showdialog method, so i cant acces to window directly so i need  to make  named Owner Dependency Property   
   public static readonly DependencyProperty TestProperty =
    DependencyProperty.Register("Owner",
                                typeof(ContentControl),
                                typeof(RadWindow),
                                new FrameworkPropertyMetadata("Owner"));
    public ContentControl Test
    {
        get { return (ContentControl)TestProperty.GetValue(TestProperty); }
        set { this.SetValue(TestProperty, value); } like this  but it dosent work if you have sample about  i will be so happy
    }
0
Kalin
Telerik team
answered on 01 Apr 2014, 01:37 PM
Hi Seycan,

We tried to reproduce the explained scenario and appears the binding doesn't work because the MainWindow hasn't been initialized yet and the property cannot be set. However the only solution would be to set the Owner in the code behind of the UserControl - in the implementation of the interface or in the constructor. Check the attached sample project which demonstrates the exact approach. However if this is not exactly your case you could adjust the demonstrated approach as per your requirements.

I hope this will help you to achieve the required.

Regards,
Kalin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Seycan
Top achievements
Rank 1
answered on 01 Apr 2014, 02:34 PM
Firtsly thanks your attentions  exactly i search like that sample but  i have a little problem about it again ,i tried it but it didnt work :( probably i have ImainView interface   i dont know how i can explain , when app starts project it dosent start  window , it start viewmodel that has ImainView interface , can it be problem because as you said ,i think so mainview hasn't been initialized ,can you help little bit please
0
Seycan
Top achievements
Rank 1
answered on 03 Apr 2014, 12:46 PM
Hi Kalin so much thanks your answers 
you shared a sample as i wanted but i couldnt explaın more details to you so i am so sorry,
i try to tell my problem again ,Normally i have windows that has  viewmodels , a windowbase class for opening windows and Idialog interface also the dialog interface has just a void showdialog method ,and when i open  those viewmodels probably pc couldnt see which windows are the mainwindow, you shared the sample to me  but  i think, it isnt exactly what i want sample also  i try to add owner property in the Idialog interface but it couldnt work still, maybe  i use to it wrongly can you help me   a more last time
0
Kalin
Telerik team
answered on 04 Apr 2014, 11:07 AM
Hi Seycan,

I'm sorry but we are not able to recreate the exact scenario on our side. What I am going to ask you is to modify the project I attached in the my previous post in order to demonstrate the exact scenario and reproduce the issue. Afterwards you can open a support ticket and send the project to us, this way we will be able to investigate the situation and provide you with the correct solution.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Seycan
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Seycan
Top achievements
Rank 1
Share this question
or