WPF Designer does not display Telerik UI (RadWindow)

1 Answer 107 Views
Window
Philipp
Top achievements
Rank 1
Iron
Philipp asked on 05 Dec 2022, 11:37 AM | edited on 05 Dec 2022, 11:38 AM

Hello,

I am using Telerik UI for WPF 5.0 version 2021.3.1109 (NoXAML version) in Visual Studio 16.11.17.

My problem is that the WPF UI designer does not display the telerik RadWindows I design. The error message is:

XDG0062 The resource "RadWindowStyle" could not be resolved.

I already followed the instructions given in this KB article. This article especially mentions to include the following XAML in my RadWindows, but that did not solve my problem:

<telerik:RadWindow (namespaces omitted) ... Style="{StaticResource RadWindowStyle}"/> 

In my Application file, I have a Style declaration like this:

<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.FileDialogs.xaml"/>
                <ResourceDictionary>
                    <Style TargetType="views:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

In the application file, I do not get the above error message (XDG0062).

So I concluded that somehow, my Window classes (e.g. MainWindow) don't receive the declared styles.

Important: I have setup my project as a Console Project (because I must implement a CLI and this was the easiest way). The UI is started with the following C# lines of code in Program.cs:

Application app = new Appl();
app.Run();
Type Appl is my WPF Application XAML.
The application runs fine when started but it would be great to use the XAML designer in VS as intended. Can you please provide some help?

1 Answer, 1 is accepted

Sort by
0
Accepted
Philipp
Top achievements
Rank 1
Iron
answered on 05 Dec 2022, 03:35 PM
I resolved my problem by moving the main Application file from <AppNamespace>.Appl(.cs) to the default location and filename: Top of the project (next to Program.cs) and renamed the file and class to App(.cs).
Martin Ivanov
Telerik team
commented on 06 Dec 2022, 11:11 AM

Thank you for sharing your solution.
Tags
Window
Asked by
Philipp
Top achievements
Rank 1
Iron
Answers by
Philipp
Top achievements
Rank 1
Iron
Share this question
or