Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to avoid Invalid Markup after generating x:Static markup extension

$
0
0

I have a visual studio extension which generates localization code for different project types.

With WPF projects, my technique is to generate named resources - usually in Resources.resx - and use the markup extension x:Static to refer to the resource string.

For example, with the XML prefix

xmlns:res="clr-namespace:<root namespace>.Properties

and the markup extension

{x:Static res:Resources.Hello_World2}

After generating this code, the XAML design window look like this:

As soon as I compile the project, the error is removed, and the XAML designer is able to show the UI.

Now I could probably live with that, but I want to make a good product and I want it to make a good impression on new users. It would be a lot cooler if my extension generated this code, and the XAML designer showed the results immediately.

Is there any to achieve this, without actually recompiling the project?

By the way, intellisense does know about the new symbol, and if I select "go to definition" (F12) it correctly goes to the code in the Resources.Designer.cs file. Only the design view is a problem.

(I have already asked this question on StackOverflow, but there has been no reply after 20 days.)

Phil


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>