Tom Kris
Tom Kris

Reputation: 1227

ContentTemplate does not work with DXWindow?

I want to use a ContentTemplate property with my window. First I tried it with standard Window class:

<Window.ContentTemplate>
    <DataTemplate>
        <DockPanel LastChildFill="true">
            <TextBlock DockPanel.Dock="Top">Hello world</TextBlock>
            <ContentPresenter Content="{Binding}" />
        </DockPanel>
    </DataTemplate>
</Window.ContentTemplate>
<Button>TestButton</Button>

This works the way I want:

enter image description here

Now try to do the same thing with DXWindow (I'm using DevExpress 10.2.4 version):

<dx:DXWindow.ContentTemplate>
    <DataTemplate>
        <DockPanel LastChildFill="true">
            <TextBlock DockPanel.Dock="Top">Hello world</TextBlock>
            <ContentPresenter Content="{Binding}" />
        </DockPanel>
    </DataTemplate>
</dx:DXWindow.ContentTemplate>
<Button>TestButton</Button>

But this does not work, looks like this property is ignored

enter image description here

Is it possible to fix this behavior?

Thank you.

Upvotes: 1

Views: 927

Answers (1)

DevExpress Team
DevExpress Team

Reputation: 11376

I see the problem with this xaml (it fails with error in the latest version (10.2.5)):

The DXWindow.ContentTemplate with the ContentPresenter raises exception

We will fix this issue in the future.

Could you please explain why you are using ContentTemplate and do not want to add both controls directly to DXWindow.

Upvotes: 2

Related Questions