The technique illustrated in the linked question/answer may go some way towards giving conditional processing of XAML elements, but I don't think it is going to give you exactly what you are after.
There are another two options that may be better suited to your needs: programmatic conditional compilation and conditional inclusion at build time.
For the programmatic conditional compilation you can use regular conditional compilation in the code behind of your view (preferable as it's a UI element you're affecting) or in the viewmodel (not so pure, but totally acceptable if you have to include it in multiple layers). This conditional compilation can be used to either change what values are returned from properties (by changing which lines are compiled in and therefore executed) or by eliminating blocks of code (this is clunky but still effective), you can then have a XAML DataTrigger that has an expression dependent on the conditionally compiled code.
The other option is to specify control templates in a XAML resource file and either programmatically select them or use a MSBuild property in an ItemGroup
expression in your proj file to control which files are included in the build. Combined with regular programmatic conditional compilation in your models/viewmodels this should give you a nice clean solution for your problem - in fact using this option you possibly don't even need the programmatic conditional compilation.
A TemplateSelector may also help, but IMVHO its a bit of a filthy hack. A TemplateSelector is supposed to swap a template based on type, but you can also exploit this to include extra code to determine the template to use - this could be a good spot to include conditionally compiled code.