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

Error when using the SyntaxEditor with implicit styles

4 Answers 138 Views
SyntaxEditor
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 19 Jan 2020, 07:29 PM

Hi,

I'm just beginning with the syntax editor, so am using a simple test project with nothing but a RadSyntaxEditor in a MainWindow.

I am using the separate NuGet packages (version 2020.1.115) with implicit styles (Fluent theme).

What I find is that even with nothing else, I get an error from my App.xaml file saying "Cannot find resource named 'DragVisualStyle'. Resource names are case sensitive." This doesn't seem to prevent the project from building and running, but still it is an error that shows in the error list and I seem to be unable to get rid of it.

After a small amount of investigation, it does seem that the resource dictionary for the SyntaxEditor (at least for the Fluent theme, but maybe others) is referencing the DragVisualStyle without defining it. Looking at some of the other controls it seems that they do each redefine that style if they need it, so the SyntaxEditor seems to differ in that respect.

I wanted to attach a simple example solution, but can't attach .zip files, so basically reproducing this amounts to creating a new WPF project, adding PackageReferences to the SyntaxEditor and Fluent theme NuGet packages, then merging the following in App.xaml:

    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.SyntaxEditor.xaml" />

And having the following in MainWindow.xaml:

    <telerik:RadSyntaxEditor/>

Thanks

4 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 21 Jan 2020, 08:07 AM

Hello Adam,

I followed the steps you listed in order to reproduce the problem but I was not able to. Please check whether there are references in your project to 

  • Telerik.Windows.Controls.dll
  • Telerik.Windows.Controls.Input.dll
  • Telerik.Windows.Controls.SyntaxEditor.dll
  • Telerik.Windows.SyntaxEditor.Core.dll
  • Telerik.Windows.Themes.Fluent.dll

The only way I can get the error related to DargVisualStyle is to remove the reference to Telerik.Windows.SyntaxEditor.Core binary. 

I hope this helps. Let me know in case the problem persists.

 

Regards,
Vera
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.

0
Adam
Top achievements
Rank 1
answered on 21 Jan 2020, 09:50 AM

Hi Vera, thanks for having a look.

I definitely have the Telerik.Windows.SyntaxEditor.Core assembly in the output directory of the project, but there is no direct reference to it in the project because I am using PackageReference for my NuGet packages, not packages.config.

I thought that might be something to do with it, so I tested a new packages.config project instead but I still get the same problem (see the attached screenshot).

So the absolute minimal reproduction steps I can come up with are:

1. Create a new WPF project on .NET 4.7.2 using Visual Studio 2019 (latest version, 16.4.3).

2. Add the NuGet package Telerik.Windows.Controls.SyntaxEditor.for.Wpf 2020.1.115 to the project.

3. Add the NuGet package Telerik.Windows.Themees.Fluent.for.Wpf 2020.1.115 to the project.

4. Paste the resource dictionary references from my original post (wrapped in <ResourceDictionary> and <ResourceDictionary.MergedDictionaries> elements) into <Application.Resources> in App.xaml.

After doing those four steps, I immediately get the error and no amount of building or closing/reopening the solution etc seems to make it go away.

If you still can't reproduce this, then I suppose that it's not that important and you can close this issue, because as I said it doesn't prevent my application from running. It just seems to be a "not real" designer error which is annoying.

Thanks,

Adam

0
Accepted
Vera
Telerik team
answered on 21 Jan 2020, 02:30 PM

Hello Adam, 

Thank you for the detailed steps. I reproduced the problem and logged it in our Feedback portal as SyntaxEditor: 'Cannot find resource named 'DragVisualStyle' with implicit styles where you can follow its status. I also updated your Telerik points accordingly. 

Excuse us for any inconvenience caused. 

Regards,
Vera
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.
0
Adam
Top achievements
Rank 1
answered on 21 Jan 2020, 03:07 PM
Ok, thanks for the help Vera.
Tags
SyntaxEditor
Asked by
Adam
Top achievements
Rank 1
Answers by
Vera
Telerik team
Adam
Top achievements
Rank 1
Share this question
or