locked
ContentPresenter's border does not work RRS feed

  • Question

  • Hi,

     I've tried code and XAML to get the border showing in the ContentPresenter control and I just can't get it to work.

     Is this a bug?

    --- example ---

    <ContentPresenter BorderBrush="Black" BorderThickness="1" Content="some content that should have a border"/>

    Thanks,

    James

    Tuesday, August 19, 2008 2:23 PM

Answers

  • Hello, write this:

    <Border BorderBrush="Black" BorderThickness="1">

    <ContentPresenter/>

    </Border>

    Thursday, August 21, 2008 5:55 AM

All replies

  • From Msdn in BorderBrush property

    This property only affects a control whose template uses the BorderBrush property as a parameter. On other controls, this property has no impact. 

    I think ContentPresenter doesn't use BorderBrush in its template. Button has one for example.

    Wednesday, August 20, 2008 11:42 AM
  • Hello, write this:

    <Border BorderBrush="Black" BorderThickness="1">

    <ContentPresenter/>

    </Border>

    Thursday, August 21, 2008 5:55 AM
  • OK thanks,

     I do know how to create a border.  I just thought it odd that contentpresenter would use a borderbrush and borderthickness property, and it didn't do anything.

    Thursday, August 21, 2008 6:46 AM