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

Would like to associate an custom file type to XAML files

$
0
0

This is likely a very basic question so please forgive me in advance.

BACKGROUND

Initially a XAML file in a C# project has a .cs (code behind) file associated to it. I would like to create a package that associates another file extension type to each .XAML file.

The file type is based on a DSL model I have built that enumerates the XAML and derives specific Domain elements from it, and performs some T4 code gen as a result of user changes to their model. Assume for this discussion that my DSL model file extension is called *.myDsl.

Currently, in order to add a new MyDSL model into my project  I have to invoke the AddNew command and select from list of installed packages to add a DSL Model to my project, then upon startup in my DSL code, I need to enumerate the VS project to obtain all files of type XAML then provide a dialog for the user to associate the new DSL editor to that model. 

What I'd like to do instead is to right-click any XAML file, and have a Menu option that says Add New MyDSL.  Further I would like that new DSL file to be associated to the XAML much like .cs. In that way if the developer wishes to edit a previously saved DSL file they simply expand the xaml and see not only the related .cs file but also the .myDSL file (if one exists).

Given that I already have an editor for the .myDSL files, here are my questions;

  1. With a Menu option how can I install a new DSL without the developer needing to invoke AddNew?
  2. How do I associate my extension to .XAML files?


Johnny Larue, http://www.softlandingcanada.com







Viewing all articles
Browse latest Browse all 4410

Trending Articles



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