Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

WPF VisualBrush

Name: Anonymous 2014-02-05 18:25

Hi guys, I've asked this on a few forums but I'm not getting any replies. Can someone please help me work out why the VisualBrush in the following code doesn't display?

<ControlTemplate TargetType="TextBox" x:Key="textBoxTemplate_watermark" xmlns:sys="clr-namespace:System;assembly=mscorlib">
            <TextBox x:Name="TextBox1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="#FFC9CBD1" />
            <ControlTemplate.Resources>
                <VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center" Stretch="None">
                    <VisualBrush.Visual>
                        <Label Background="Black" Padding="10,0,0,0" Content="{Binding ElementName=TextBox1, Path=ToolTip}" Foreground="Gray" />
                    </VisualBrush.Visual>
                </VisualBrush>
            </ControlTemplate.Resources>
            <ControlTemplate.Triggers>
                <Trigger Property="Text" Value="{x:Static sys:String.Empty}">
                    <Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
                </Trigger>
                <Trigger Property="Text" Value="{x:Null}">
                    <Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
                </Trigger>
                <Trigger Property="IsKeyboardFocused" Value="True">
                    <Setter Property="Background" Value="White" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

Name: Anonymous 2014-02-06 6:50

lick my throbbing dick

Name: Anonymous 2014-02-06 15:11

You didn't set a ToolTip on TextBox1, so the Label will always be blank. Perhaps you meant {TemplateBinding ToolTip}?

P.S. this seems like a TERRIBLE way of achieving this effect!

Name: Anonymous 2014-02-07 13:12

LEL MY ANUS IS IN ORBIT

Name: Anonymous 2014-02-07 21:28

what the fuck is this abortion

Don't change these.
Name: Email:
Entire Thread Thread List