XamlC extensibility

wesharpwesharp ITMember ✭✭


Enable the XamlCTask extension to improve the performance of your custom libraries.

API Changes

If the .nuget package of the custom library contains a dll with the name like [libraryname] .xamlc.dll . XamlCTask automatically adds it to the parsing queue.

Intended Use Case

I'm developing AutoCommandBindig MarkupExtension and I would like to enable early detection of method discovery to improve its performance.


Open · Last Updated


  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    The way XamlC picks compiled versions of markup extensions is through the ProvideCompiledAttribute. That attribute, at this time, is still internal, and I don't feel like opening it yet. It'd require a very good use case. Custom markup extensions might not be that use case.

  • wesharpwesharp ITMember ✭✭

    In my case in the MarkupExtension I'm developing, use refletcion to binding the Command Automatically to the viewmodel without define Command.
    Like this:

    in xaml

    <Button Command="{Auto Do}"/>

    in viewmodel

      bool CanDo(object parameter)
      void Do(object parameter)

    there are many cases of use where it can be useful.

    • extend the language, an example may be what you are doing with CSS
    • Create a navigation routing system like asp.net mvc
    • etc...

    In general, in all cases where there is a need to optimize the performances and can be solved during compilation.

Sign In or Register to comment.