Display design time element instead of run time respective element

200 Views Asked by At

I am using design time namespace to use design time properties and elements. I use

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

Now, I need to define design time element, let's say

<d:TextBlock Text="design time text block" />

But in runtime, I want to display other text block:

<TextBlock Text="runtime text block" />

How to define both elements, so design time elemnt is displayed instead of respective run time element?

The way I fiugred out is:

<Grid>
    <d:TextBlock Text="design time text block" />
    <TextBlock Text="runtime text block" />
</Grid>

But I don't want to define extra container. I could also use <d:Grid>`, but it justs omits whole grid together with text block in runtime.

I know I can use d:Text design time property, but in real situation I need to set attached property on element, whcih already has its own namespace, eg. ns:AttachedProp and I cannot use two namespaces like d:ns:AttachedProp.

0

There are 0 best solutions below