RadWindow does not show

2 posts, 0 answers
  1. Stav
    Stav avatar
    9 posts
    Member since:
    Dec 2013

    Posted 21 Jul Link to this post

    hello Telerik,

    I'm trying to use RadWindow AS user control

    I'm having a problem with RadWIndow's Show() method.

    I was going over your 'Use RadWindow as User Control' explanation and there is a part where is says :

    RadWindowControl window = new RadWindowControl();

    window.Show();

     

    in my code, the way that my RadWIndow (CapabilityLayer) created is from ResourseDictionary:

    <ResourseDictionary>

    <DataTemplate DataType="{x:Type localVM:CapabilityViewModel}">

    <localVIew:CapabilityLayer/>

    </DataTemplate>

    </ResourseDictionary>

     

    I'm only using "new" in order  to create CapabilityViewModel but CapabilityLayer is automatically created, this is why I dont know where to invoke the Show() method I dont have instance to CapabilityLayer.xaml .

    at the moment no errors or exceptions it just that the window is not shown

    I tried to invoke Show() in the RadWindow's OnLoad event but it still no show.

    I tried to find the radwindow through Application.Current.Windows but I didnt find it there.

    where is the right place to put this method ? I saw that some time it is recommended to use ShowDIalog() what is the different?  Show() is where RadWindow create or it is only some kind of visibility set?  

    thank you

     

     

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Jul Link to this post

    Hello Stav,

    You cannot place the RadWindow UserControl in XAML as when it is shown it is not in the same visual tree as the parent Window. In your case, you could subscribe to some event (Loaded, for example) and in its handler call the Show() method of the CapabilityLayer ( which I assume is the RadWindow).

    I hope this will be helpful.

    Regards,
    Yana
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top