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


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


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