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

RadWindow not showing

7 Answers 1332 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 23 Apr 2016, 12:20 PM

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).

 

7 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 25 Apr 2016, 08:27 AM
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.
0
Andrew
Top achievements
Rank 1
answered on 25 Apr 2016, 12:39 PM
Thanks Yana, thats sorted it. Appreciate the fast help!
0
Jonah
Top achievements
Rank 1
answered on 05 Dec 2016, 04:40 PM
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.
0
Kalin
Telerik team
answered on 07 Dec 2016, 08:08 AM
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.
0
Jonah
Top achievements
Rank 1
answered on 07 Dec 2016, 02:28 PM
That was the case, when I ran the upgrade wizard it used the no binaries DLLS. After changing them out everything worked fine.
0
Ruslan
Top achievements
Rank 1
answered on 12 Jul 2017, 11:06 PM

I'm using Implicit Styles and copy all necessary XAML's into my project. My App.xaml:

<Application x:Class="test.App" <br>             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <br>             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <br>             xmlns:local="clr-namespace:test"<br>             StartupUri="MainWindow.xaml"><br>    <Application.Resources><br>        <ResourceDictionary><br>            <ResourceDictionary.MergedDictionaries><br>                <ResourceDictionary Source="DarkTheme/System.Windows.xaml" /><br>                <ResourceDictionary Source="DarkTheme/Telerik.Windows.Controls.xaml" /><br>                <ResourceDictionary Source="DarkTheme/Telerik.Windows.Controls.Navigation.xaml" /><br>            </ResourceDictionary.MergedDictionaries><br><br>            <!--Is it possible to not use it for every window?--><br>            <!--<Style TargetType="local:AdditionalWindow" BasedOn="{StaticResource RadWindowStyle}"/>--><br>        </ResourceDictionary><br>    </Application.Resources><br></Application>

How can I style all RadWindows without using explicit styling?
Thanks.

0
Kalin
Telerik team
answered on 17 Jul 2017, 10:11 AM
Hi Ruslan,

As another option you could set the Style property of each of the custom RadWindows to DynamicResource RadWindowStyle as shown below:

<telerik:RadWindow x:Class="Sample.MyCustomRadWindow"
             ...
             Style="{DynamicResource RadWindowStyle}"
             ...>

Hope this helps.

Regards,
Kalin
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Window
Asked by
Andrew
Top achievements
Rank 1
Answers by
Yana
Telerik team
Andrew
Top achievements
Rank 1
Jonah
Top achievements
Rank 1
Kalin
Telerik team
Ruslan
Top achievements
Rank 1
Share this question
or