firstfloorsoftware / xcc

XAML Conditional Compilation
Microsoft Public License
58 stars 16 forks source link

How can I apply the preprocessor to a root level element that already has a namespace? #12

Open mrbedo opened 8 years ago

mrbedo commented 8 years ago

For example, when I want to exclude MyCustomWindow from compiling:

<myns:MyCustomWindow
    x:Class="My.Namespace.MyCustomWindow"
    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:myns="clr-namespace:My.Namespace"
    xmlns:IF_DEBUG="condition:DEBUG"
    mc:Ignorable="d IF_DEBUG">
</myns:MyCustomWindow>

How would I do that? <IF_DEBUG:myns:MyCustomWindow??? wouldn't work in wpf.

Otherwise, great tool!

kozw commented 8 years ago

Good point, this particular scenario is not supported by XCC. When rewriting xml prefixed elements, XCC falls back to the default root namespace. You can't currently rewrite an element or attribute to another namespace.

This one requires some thinking