Designer doesn't show anything

3 Answers 35 Views
Window
Marco
Top achievements
Rank 1
Iron
Marco asked on 29 Jun 2021, 09:09 AM

We upgraded our project to the newest version of telerik UI for WPF. But now no controls are showed in the designer. We use implicit styles. So it shouldn't be a problem with the NoXaml dll's.

 

I tried to add every source from the theme like that:

   <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Cloud.Controls.xaml" />

 

But it do not show anything in the designer. It is always empty.

I also tried to clean the project, then delete the bin and obj folder and rebuild it. Doesn't help.

I tried everything in this post: No Telerik controls in Design view in UI for WPF | Telerik Forums

But same result, nothing helps.

Someone have an idea?

3 Answers, 1 is accepted

Sort by
2
Accepted
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
answered on 29 Jun 2021, 11:46 AM | edited on 29 Jun 2021, 12:03 PM

 

The pink part should come with the assembly name. (This way use the theme dll, Don't use implicit style)

< ResourceDictionary  Source = "/ Telerik.Windows.Themes.Office2013 ; component / Themes / Telerik.Windows.Controls.xaml" /> 
< ResourceDictionary  Source = "/ Telerik.Windows.Themes.Office2013 ; component / Themes / Telerik.Windows. Controls.GridView.xaml " /> 


Please try again and check.

< ResourceDictionary  Source= "pack : // application : ,,, / YourAssembly; component / Themes / Telerik.Windows.Controls.xaml"/> 

assemblyName; Components / Folders / Folders ... /. xaml

Or try passing the component.

 

I think you are confused. That method is used through the theme dll.
Check out this post for more details.

https://www.telerik.com/forums/how-to-use-the-noxaml-binaries

Marco
Top achievements
Rank 1
Iron
commented on 29 Jun 2021, 12:06 PM

Well, they use this resourcedictionary:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

I think I am doing exactly the same but instead of Windows8 theme, I use Office2013 Theme. Am I wrong?
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
commented on 29 Jun 2021, 12:12 PM

what are you using?

Your post uses implicit style, but the ResourceDictionary uses theme dll usage.

Attach a small sample or read the link I gave you.
Marco
Top achievements
Rank 1
Iron
commented on 29 Jun 2021, 01:09 PM

Yes, you were completely right. I totally misunderstood the functionallity from NoXaml and Implicit Styles. Your posted link helped a lot. Thank you soo much.
0
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
answered on 29 Jun 2021, 11:17 AM | edited on 29 Jun 2021, 11:18 AM

Helllo.

 

Have you also defined namespaces on the Window or UserContorl?

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

 

Read the documentation and follow it step by step.

https://docs.telerik.com/devtools/wpf/styling-and-appearance/styling-apperance-setting-a-theme-overview

 

If you are using MVVM and put the DataContext in Xaml, please set it again in the constructor.

Or, try referring to my example in the previous post. My example sample is implemented in Noxaml implicit style.

0
Marco
Top achievements
Rank 1
Iron
answered on 29 Jun 2021, 11:35 AM

Thanks for your help. I have created a test control to show you my cases:

<UserControl x:Class="UserControls.Forms.TestUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <telerik:RadGridView>
            <telerik:RadGridView.Columns>
                <telerik:GridViewColumn Header="Hello"></telerik:GridViewColumn>
                <telerik:GridViewColumn></telerik:GridViewColumn>
                <telerik:GridViewColumn></telerik:GridViewColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <telerik:RadWatermarkTextBox Grid.Column="1"></telerik:RadWatermarkTextBox>
    </Grid>
</UserControl>

And this shows a empty control (after clean, reopening VS, rebuild):

And my app.xaml contains following resources, which are used by RadWatermarkTextbox or RadGridView:

<ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml" />

My project has also a reference to telerik.windows.data, which is used for RadGridView, but isn't in the Theme.

The DataContext is set to the CodeBehind in the constructor.

Tags
Window
Asked by
Marco
Top achievements
Rank 1
Iron
Answers by
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Marco
Top achievements
Rank 1
Iron
Share this question
or