contentpresenter

Display image in content presenter in button

I have a button with a style that displays an image inside it. I would like to be able to specify the image it uses using the Content property on the button (or some other means). How can accomplish this without actually nesting an image directly in the button. <BitmapImage x:Key="closeImage" UriSource="close.png" /> I thought I co...

Having trouble binding the Visibility of a ContentPresenter in WPF

I have the following XAML: <UserControl.Resources> <DataTemplate x:Key="ExpanderTemplate"> <Grid> <Rectangle Stroke="Black" StrokeThickness="1" Width="10" Height="10" Fill="White" /> <Rectangle Stroke="Black" StrokeThickness="1" Width="6" Height="1" Fill="Black" /> <Rectangle Stroke="Black" StrokeThickness="...

Apply a style to TextBlocks within a ContentPresenter in Silverlight

If I have the following style defined: <UserControl.Resources> <Style TargetType="TextBlock" x:Key="ProblemStyle"> <Setter Property="FontSize" Value="40"/> <Setter Property="FontWeight" Value="Bold"/> </Style> </UserControl.Resources> Then when I have a ContentPresenter data bound to a string, in WPF I can get ...

I cannot seem to find a way to access the content inside the ContentPresenter to be able to update the parent(s)

Hi, I am making a collapsible ContentControl. Everything works fine until I try to embed a collapsible ContentControl as content inside the ContentPresenter of the same type collapsible control. The collapsing and expanding is done using animations. But when the content of the collapsible control changes in size it will not update its pa...

WPF 4 ContentPresenter TextWrapping style is not applied to implicitedly generated TextBlock

If I assign a piece of text to the Content property of a ContentPresenter a TextBlock control is generated by the ContentPresenter at render time to contain that text. If I create a style that applies to TextBlock properties and assign it to that ContentPresenter, the does not appear to apply to the implicitly generated TextBlocks. <St...