我有应作为容器的用户控件,它看起来像如下:WPF容器控件
<ContentControl ... >
<Grid>
<Rectangle RadiusX="8" RadiusY="8">
<Rectangle.Fill>
...
</Rectangle.Fill>
</Rectangle>
...
<ContentPresenter />
</Grid>
</ContentControl>
当我在一个窗口中使用它,控件的内容被替换,而不是投入ContentPresenter:
<XWpf2:MyContainer Margin="40">
<ListView Margin="16" />
</XWpf2:MyContainer>
什么是正确的方法,这里有什么问题?
相似的问题:http://stackoverflow.com/q/10269284 –