Seeking better solution for Conditional XAML
===

I'm looking for a solution which is equivalent to the below. That is, add some more buttons in the tool bar if and only if a macro SUPPORT_BAR is defined in the project.

I found there were solutions which defined multiple options with template or something like that, and selected one of them in the code, with normal conditional compilation. IMO those might be a workaround but not the solution.

The best solution I know was in 2006.  http://www.removingalldoubt.com/PermaLink.aspx/defa2a7d-b1e9-49eb-b8c8-438348be8d18

But now I'm wondering if there's a better one after 6 years.


    <ToolBar>
        <Button>Foo1</Button>
        <Button>Foo2</Button>
    #if SUPPORT_BAR
        <Separator />
        <Button>Bar1</Button>
        <Button>Bar2</Button>
    #endif
    </ToolBar>