RadWindow not showing

6 posts, 1 answers
  1. Andrew
    Andrew avatar
    2 posts
    Member since:
    Apr 2016

    Posted 23 Apr Link to this post

    I'm just starting out with WPF and with the Telerik controls and am trying to work with RadWindow; I'm following the example in "User RadWinfow as UserControl" and the window is running but it is not displaying on the screen. I've followed the example to the letter so stuck as to what the issue is?

    The RadWindow XAML is as per the example:

    <telerik:RadWindow x:Class="Temp.TelerikScenario1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Header="TelerikScenario1" Height="300" Width="300">
    <Grid>
    </Grid>
    </telerik:RadWindow>

    and so is the code:

    public partial class TelerikScenario1
    {
    public TelerikScenario1()
    {
    InitializeComponent();
    }
    }

    Then I try to open in the MainWindow.xaml.cs:

     

    public MainWindow()
    {
    InitializeComponent();
    TelerikScenario1 window = new TelerikScenario1();
    window.Show();
    }

    And whilst I can see the code is running for the TelerikScenario1 RadWindow it is not displayed on the screen? (if I declare a new Radwindow in c#  "RadWindow radWindow = new RadWindow();" then that opens fine).

     

  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Apr Link to this post

    Hello Andrey,

    Thank you for your interest in UI for WPF.

    I guess that you're using Implicit Styles to apply a theme to our WPF controls - in this case RadWindow will not receive its Style automatically as it's already of different type ( TelerikScenario1 ), so you should manually add the required Styles inside App.xaml like this:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
               ...
            </ResourceDictionary.MergedDictionaries>
     
            <Style TargetType="local:TelerikScenario1" BasedOn="{StaticResource RadWindowStyle}" />
        </ResourceDictionary>
    </Application.Resources>

    where local refers to the namespace where RadWindow is placed. In the concrete case, it should be set like this:

    xmlns:local="clr-namespace:Temp"

    I hope this would be helpful. If you have any additional questions, let us know.

    Regards,
    Yana
    Telerik
    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
  4. Andrew
    Andrew avatar
    2 posts
    Member since:
    Apr 2016

    Posted 25 Apr in reply to Yana Link to this post

    Thanks Yana, thats sorted it. Appreciate the fast help!
  5. Jonah
    Jonah avatar
    23 posts
    Member since:
    Oct 2012

    Posted 5 days and 21 hours ago Link to this post

    Does this need to be done for each RadWindow in the project? I just updated to the latest version of WPF UI and now none of my windows are showing up. They all worked fine with a previous version.
  6. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 4 days and 5 hours ago Link to this post

    Hi Jonah,

    If all the RadWindows were appearing before the upgrade, this should be related to the referenced binaries. If you were using XAML binaries and switch to no XAML ones that might happen. So please check if the references are pointing to the correct folder. If this is not the case, please share some more details regarding project - are you using custom RadWindows, which theme you are using and how do you apply it?

    Hope this helps.

    Regards,
    Kalin
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
  7. Jonah
    Jonah avatar
    23 posts
    Member since:
    Oct 2012

    Posted 3 days and 23 hours ago in reply to Kalin Link to this post

    That was the case, when I ran the upgrade wizard it used the no binaries DLLS. After changing them out everything worked fine.
Back to Top
UI for WPF is Visual Studio 2017 Ready