+4  A: 

There are a number of ways to do this, but I would suggest exposing your own property on your user control and binding to that inside your user control. For example:

<UserControl x:Name="_root" ...>
    ...
    <Button Background="{Binding ButtonBackground, ElementName=_root}"/>
</UserControl>

Another way would just be to explicitly set the background color of the TextBox to something.

HTH, Kent

Kent Boogaart
+1  A: 

I agree with Kent. There are a number of ways that you can solve this problem.

But what about just using a Style in the UserControl to set the Background of the TextBox? Is there any special reason that the following wouldn't work for you?

<UserControl
    x:Class="StackOverflowQuestion.UserControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300"
    Width="300"
>
    <UserControl.Resources>
        <Style x:Key="textBoxStyle" TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </UserControl.Resources>
    <DockPanel>
        <TextBox Text="Test" Style="{StaticResource textBoxStyle}"/>
        <Button/>
    </DockPanel>
</UserControl>

If you truly want to utilize a property set on the user control and have it affect the internals of the user control, I would follow Kent's suggestion with one modification. I would Bind the Background of the TextBox instead so that whatever Background Brush the user set on the user control would flow (property value inheritance) to the Button. Or, in other words, the Background of the TextBox is really what you are trying to make different.

<UserControl x:Name="_root" ...>
    <TextBox Background="{Binding TextBoxBackground, ElementName=_root}"/>
    <Button/>
</UserControl>
cplotts