Show Dialog Window lost

9 posts, 1 answers
  1. Seycan
    Seycan avatar
    8 posts
    Member since:
    Dec 2013

    Posted 31 Mar 2014 Link to this post

    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,
  2. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 31 Mar 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Seycan
    Seycan avatar
    8 posts
    Member since:
    Dec 2013

    Posted 31 Mar 2014 Link to this post

    thanks but  i  forgot to say you , i use wpf mvvm so i need to owner dependecy property sample for using bind to window
  5. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 01 Apr 2014 Link to this post

    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.

     
  6. Seycan
    Seycan avatar
    8 posts
    Member since:
    Dec 2013

    Posted 01 Apr 2014 Link to this post

    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
        }
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 01 Apr 2014 Link to this post

    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.

     
  8. Seycan
    Seycan avatar
    8 posts
    Member since:
    Dec 2013

    Posted 01 Apr 2014 in reply to Kalin Link to this post

    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
  9. Seycan
    Seycan avatar
    8 posts
    Member since:
    Dec 2013

    Posted 03 Apr 2014 in reply to Kalin Link to this post

    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
  10. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 04 Apr 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready