locked
Changing Text in Textbox in Control Template (dbaechtel) - 10/9/2006 8:38 AM PST RRS feed

  • Question

  • By: dbaechtel

    I have several Buttons in a WrapPanel that are derived from a ControlTemplate 
    for the Buttons. The ControlTemplate contains a TextBox that serves as a 
    label for the Buttons. I would like to use the Tag property(string) in the 
    Button object as the Text for the TextBox label. In that way each Button can 
    get a specific label for the Button. Does anyone know how use the Tag 
    property of the Button object as the Text in the TextBox within the Control 
    Template or a better way to do this in EID?
    
    Button XAML:
    <Button HorizontalAlignment="Stretch" Width="70" Height="70" x:Name="NewJog" 
    Background="sc#0.2, 0.876573265, 0.201642692, 0.201642692" 
    Template="{DynamicResource ButtonlTemplate1}" Style="{DynamicResource 
    ButtonStyle1}" Tag="New Job">
    <Image x:Name="_4000_png" Source="4000.png"/>
    </Button>
    
    ControlTemplate XAML:
    <ControlTemplate x:Key="ButtonlTemplate1" TargetType="{x:Type ButtonBase}">
    <Grid x:Name="Grid">
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition/>
    </Grid.RowDefinitions>
    <Rectangle Fill="sc#0.2, 1, 1, 1" RadiusX="10" RadiusY="10" 
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
    Margin="2.5,2.5,2.5,2.5" Width="Auto" Height="Auto" x:Name="Rectangle" 
    IsEnabled="True">
    <Rectangle.Stroke><x:Null/></Rectangle.Stroke></Rectangle>
    <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
    x:Name="ContentPresenter" Content="{TemplateBinding Content}" 
    ContentTemplate="{TemplateBinding ContentTemplate}" Margin="5,0,5,10"/>
    
    <TextBox HorizontalAlignment="Center" VerticalAlignment="Bottom" 
    Margin="5,0,5,3.62655601659759" Height="18" Background="{x:Null}" 
    x:Name="TextBox" Foreground="#FFFFFFFF" BorderBrush="{x:Null}" Text="TextBox" 
    TextWrapping="Wrap" Focusable="False" IsEnabled="True"/>
    
    </Grid>
    <ControlTemplate.Triggers>
    <Trigger Property="IsKeyboardFocused" Value="True"/>
    <Trigger Property="ToggleButton.IsChecked" Value="True"/>
    <Trigger Property="IsEnabled" Value="False"/>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Shape.Stroke" Value="#FFF3F460" TargetName="Rectangle"/>
    <Setter Property="Shape.StrokeThickness" Value="2" TargetName="Rectangle"/>
    </Trigger>
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Property="IsPressed" Value="True"/>
    </MultiTrigger.Conditions>
    <Setter Property="Shape.Stroke" Value="sc#1, 0.8959832, 0.9053261, 
    0.116551772" TargetName="Rectangle"/>
    <Setter Property="Shape.StrokeThickness" Value="2" TargetName="Rectangle"/>
    <Setter Property="Shape.Fill" TargetName="Rectangle">
    <Setter.Value>
    <RadialGradientBrush>
    <GradientStop Color="sc#0.5, 1, 1, 1" Offset="0"/>
    <GradientStop Color="sc#1, 0.2022265, 0.215518385, 0.7633134" Offset="1"/>
    </RadialGradientBrush>
    </Setter.Value>
    </Setter>
    </MultiTrigger>
    </ControlTemplate.Triggers>
    </ControlTemplate>
    
    Thanks very much for your help.
    -- 
    Don Baechtel
    Tuesday, February 19, 2008 5:49 PM

Answers

  • By: Jen Rowe [MSFT]

    You can just use the content presenters content property and bind it to the
    parent's tag property. If you want to use the Text box within the template
    you can also bind the Text Property of the text box to the Parent
    Content="{TemplateBinding Property=Tag}
    Text="{TemplateBinding Property=Tag}"

    See below for context:

    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type Button}">


    <!-- Content Presenter is where the text content etc is placed by
    the control -->
    <!-- The bindings are useful so that the control can be
    parameterized without editing the template -->
    <ContentPresenter HorizontalAlignment="{TemplateBinding
    HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    RecognizesAccessKey="True" x:Name="contentPresenter" Width="88.042"
    Content="{TemplateBinding Property=Tag}"/>
    <TextBox HorizontalAlignment="Right" Margin="0,8,8,0"
    VerticalAlignment="Top" Width="67.979" Height="13.362"
    Text="{TemplateBinding Property=Tag}" TextWrapping="Wrap"/>
    </Grid>


    "dbaechtel" <dbaechtel@nospam.nospam> wrote in message
    news:3005FF5C-5BB4-4EB1-8422-62832D3FFF23@microsoft.com...
    >I have several Buttons in a WrapPanel that are derived from a
    >ControlTemplate
    > for the Buttons. The ControlTemplate contains a TextBox that serves as a
    > label for the Buttons. I would like to use the Tag property(string) in the
    > Button object as the Text for the TextBox label. In that way each Button
    > can
    > get a specific label for the Button. Does anyone know how use the Tag
    > property of the Button object as the Text in the TextBox within the
    > Control
    > Template or a better way to do this in EID?
    >
    > Button XAML:
    > <Button HorizontalAlignment="Stretch" Width="70" Height="70"
    > x:Name="NewJog"
    > Background="sc#0.2, 0.876573265, 0.201642692, 0.201642692"
    > Template="{DynamicResource ButtonlTemplate1}" Style="{DynamicResource
    > ButtonStyle1}" Tag="New Job">
    > <Image x:Name="_4000_png" Source="4000.png"/>
    > </Button>
    >
    > ControlTemplate XAML:
    > <ControlTemplate x:Key="ButtonlTemplate1" TargetType="{x:Type
    > ButtonBase}">
    > <Grid x:Name="Grid">
    > <Grid.ColumnDefinitions>
    > <ColumnDefinition/>
    > </Grid.ColumnDefinitions>
    > <Grid.RowDefinitions>
    > <RowDefinition/>
    > </Grid.RowDefinitions>
    > <Rectangle Fill="sc#0.2, 1, 1, 1" RadiusX="10" RadiusY="10"
    > HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    > Margin="2.5,2.5,2.5,2.5" Width="Auto" Height="Auto" x:Name="Rectangle"
    > IsEnabled="True">
    > <Rectangle.Stroke><x:Null/></Rectangle.Stroke></Rectangle>
    > <ContentPresenter HorizontalAlignment="Stretch"
    > VerticalAlignment="Stretch"
    > x:Name="ContentPresenter" Content="{TemplateBinding Content}"
    > ContentTemplate="{TemplateBinding ContentTemplate}" Margin="5,0,5,10"/>
    >
    > <TextBox HorizontalAlignment="Center" VerticalAlignment="Bottom"
    > Margin="5,0,5,3.62655601659759" Height="18" Background="{x:Null}"
    > x:Name="TextBox" Foreground="#FFFFFFFF" BorderBrush="{x:Null}"
    > Text="TextBox"
    > TextWrapping="Wrap" Focusable="False" IsEnabled="True"/>
    >
    > </Grid>
    > <ControlTemplate.Triggers>
    > <Trigger Property="IsKeyboardFocused" Value="True"/>
    > <Trigger Property="ToggleButton.IsChecked" Value="True"/>
    > <Trigger Property="IsEnabled" Value="False"/>
    > <Trigger Property="IsMouseOver" Value="True">
    > <Setter Property="Shape.Stroke" Value="#FFF3F460" TargetName="Rectangle"/>
    > <Setter Property="Shape.StrokeThickness" Value="2"
    > TargetName="Rectangle"/>
    > </Trigger>
    > <MultiTrigger>
    > <MultiTrigger.Conditions>
    > <Condition Property="IsPressed" Value="True"/>
    > </MultiTrigger.Conditions>
    > <Setter Property="Shape.Stroke" Value="sc#1, 0.8959832, 0.9053261,
    > 0.116551772" TargetName="Rectangle"/>
    > <Setter Property="Shape.StrokeThickness" Value="2"
    > TargetName="Rectangle"/>
    > <Setter Property="Shape.Fill" TargetName="Rectangle">
    > <Setter.Value>
    > <RadialGradientBrush>
    > <GradientStop Color="sc#0.5, 1, 1, 1" Offset="0"/>
    > <GradientStop Color="sc#1, 0.2022265, 0.215518385, 0.7633134" Offset="1"/>
    > </RadialGradientBrush>
    > </Setter.Value>
    > </Setter>
    > </MultiTrigger>
    > </ControlTemplate.Triggers>
    > </ControlTemplate>
    >
    > Thanks very much for your help.
    > --
    > Don Baechtel

    Tuesday, February 19, 2008 9:30 PM

All replies

  • By: Jen Rowe [MSFT]

    You can just use the content presenters content property and bind it to the
    parent's tag property. If you want to use the Text box within the template
    you can also bind the Text Property of the text box to the Parent
    Content="{TemplateBinding Property=Tag}
    Text="{TemplateBinding Property=Tag}"

    See below for context:

    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type Button}">


    <!-- Content Presenter is where the text content etc is placed by
    the control -->
    <!-- The bindings are useful so that the control can be
    parameterized without editing the template -->
    <ContentPresenter HorizontalAlignment="{TemplateBinding
    HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    RecognizesAccessKey="True" x:Name="contentPresenter" Width="88.042"
    Content="{TemplateBinding Property=Tag}"/>
    <TextBox HorizontalAlignment="Right" Margin="0,8,8,0"
    VerticalAlignment="Top" Width="67.979" Height="13.362"
    Text="{TemplateBinding Property=Tag}" TextWrapping="Wrap"/>
    </Grid>


    "dbaechtel" <dbaechtel@nospam.nospam> wrote in message
    news:3005FF5C-5BB4-4EB1-8422-62832D3FFF23@microsoft.com...
    >I have several Buttons in a WrapPanel that are derived from a
    >ControlTemplate
    > for the Buttons. The ControlTemplate contains a TextBox that serves as a
    > label for the Buttons. I would like to use the Tag property(string) in the
    > Button object as the Text for the TextBox label. In that way each Button
    > can
    > get a specific label for the Button. Does anyone know how use the Tag
    > property of the Button object as the Text in the TextBox within the
    > Control
    > Template or a better way to do this in EID?
    >
    > Button XAML:
    > <Button HorizontalAlignment="Stretch" Width="70" Height="70"
    > x:Name="NewJog"
    > Background="sc#0.2, 0.876573265, 0.201642692, 0.201642692"
    > Template="{DynamicResource ButtonlTemplate1}" Style="{DynamicResource
    > ButtonStyle1}" Tag="New Job">
    > <Image x:Name="_4000_png" Source="4000.png"/>
    > </Button>
    >
    > ControlTemplate XAML:
    > <ControlTemplate x:Key="ButtonlTemplate1" TargetType="{x:Type
    > ButtonBase}">
    > <Grid x:Name="Grid">
    > <Grid.ColumnDefinitions>
    > <ColumnDefinition/>
    > </Grid.ColumnDefinitions>
    > <Grid.RowDefinitions>
    > <RowDefinition/>
    > </Grid.RowDefinitions>
    > <Rectangle Fill="sc#0.2, 1, 1, 1" RadiusX="10" RadiusY="10"
    > HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    > Margin="2.5,2.5,2.5,2.5" Width="Auto" Height="Auto" x:Name="Rectangle"
    > IsEnabled="True">
    > <Rectangle.Stroke><x:Null/></Rectangle.Stroke></Rectangle>
    > <ContentPresenter HorizontalAlignment="Stretch"
    > VerticalAlignment="Stretch"
    > x:Name="ContentPresenter" Content="{TemplateBinding Content}"
    > ContentTemplate="{TemplateBinding ContentTemplate}" Margin="5,0,5,10"/>
    >
    > <TextBox HorizontalAlignment="Center" VerticalAlignment="Bottom"
    > Margin="5,0,5,3.62655601659759" Height="18" Background="{x:Null}"
    > x:Name="TextBox" Foreground="#FFFFFFFF" BorderBrush="{x:Null}"
    > Text="TextBox"
    > TextWrapping="Wrap" Focusable="False" IsEnabled="True"/>
    >
    > </Grid>
    > <ControlTemplate.Triggers>
    > <Trigger Property="IsKeyboardFocused" Value="True"/>
    > <Trigger Property="ToggleButton.IsChecked" Value="True"/>
    > <Trigger Property="IsEnabled" Value="False"/>
    > <Trigger Property="IsMouseOver" Value="True">
    > <Setter Property="Shape.Stroke" Value="#FFF3F460" TargetName="Rectangle"/>
    > <Setter Property="Shape.StrokeThickness" Value="2"
    > TargetName="Rectangle"/>
    > </Trigger>
    > <MultiTrigger>
    > <MultiTrigger.Conditions>
    > <Condition Property="IsPressed" Value="True"/>
    > </MultiTrigger.Conditions>
    > <Setter Property="Shape.Stroke" Value="sc#1, 0.8959832, 0.9053261,
    > 0.116551772" TargetName="Rectangle"/>
    > <Setter Property="Shape.StrokeThickness" Value="2"
    > TargetName="Rectangle"/>
    > <Setter Property="Shape.Fill" TargetName="Rectangle">
    > <Setter.Value>
    > <RadialGradientBrush>
    > <GradientStop Color="sc#0.5, 1, 1, 1" Offset="0"/>
    > <GradientStop Color="sc#1, 0.2022265, 0.215518385, 0.7633134" Offset="1"/>
    > </RadialGradientBrush>
    > </Setter.Value>
    > </Setter>
    > </MultiTrigger>
    > </ControlTemplate.Triggers>
    > </ControlTemplate>
    >
    > Thanks very much for your help.
    > --
    > Don Baechtel

    Tuesday, February 19, 2008 9:30 PM
  • By: dbaechtel

    Your suggestion of adding Text="{TemplateBinding Property=Tag}" in the 
    TextBox worked just fine. THANKS!!!
    
    Is there going to be an easier way to do this without modifying the XAML by 
    hand in the EID IDE eventually? It would be really nice if the Templated 
    controls could have easy access to the parent control's properties in the IDE.
    
    -- 
    Don Baechtel
    
    
    "Jen Rowe [MSFT]" wrote:
    
    > You can just use the content presenters content property and bind it to the 
    > parent's tag property. If you want to use the Text box within the template 
    > you can also bind the Text Property of the text box to the Parent
    > Content="{TemplateBinding Property=Tag}
    > Text="{TemplateBinding Property=Tag}"
    > 
    > See below for context:
    > 
    > <Setter Property="Template">
    >      <Setter.Value>
    >       <ControlTemplate TargetType="{x:Type Button}">
    > 
    > 
    >         <!-- Content Presenter is where the text content etc is placed by 
    > the control -->
    >         <!-- The bindings are useful so that the control can be 
    > parameterized without editing the template -->
    >         <ContentPresenter HorizontalAlignment="{TemplateBinding 
    > HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
    > VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
    > RecognizesAccessKey="True" x:Name="contentPresenter" Width="88.042" 
    > Content="{TemplateBinding Property=Tag}"/>
    >         <TextBox HorizontalAlignment="Right" Margin="0,8,8,0" 
    > VerticalAlignment="Top" Width="67.979" Height="13.362" 
    > Text="{TemplateBinding Property=Tag}" TextWrapping="Wrap"/>
    >        </Grid>
    > 
    > 
    > "dbaechtel" <dbaechtel@nospam.nospam> wrote in message 
    > news:3005FF5C-5BB4-4EB1-8422-62832D3FFF23@microsoft.com...
    > >I have several Buttons in a WrapPanel that are derived from a 
    > >ControlTemplate
    > > for the Buttons. The ControlTemplate contains a TextBox that serves as a
    > > label for the Buttons. I would like to use the Tag property(string) in the
    > > Button object as the Text for the TextBox label. In that way each Button 
    > > can
    > > get a specific label for the Button. Does anyone know how use the Tag
    > > property of the Button object as the Text in the TextBox within the 
    > > Control
    > > Template or a better way to do this in EID?
    > >
    > > Button XAML:
    > > <Button HorizontalAlignment="Stretch" Width="70" Height="70" 
    > > x:Name="NewJog"
    > > Background="sc#0.2, 0.876573265, 0.201642692, 0.201642692"
    > > Template="{DynamicResource ButtonlTemplate1}" Style="{DynamicResource
    > > ButtonStyle1}" Tag="New Job">
    > > <Image x:Name="_4000_png" Source="4000.png"/>
    > > </Button>
    > >
    > > ControlTemplate XAML:
    > > <ControlTemplate x:Key="ButtonlTemplate1" TargetType="{x:Type 
    > > ButtonBase}">
    > > <Grid x:Name="Grid">
    > > <Grid.ColumnDefinitions>
    > > <ColumnDefinition/>
    > > </Grid.ColumnDefinitions>
    > > <Grid.RowDefinitions>
    > > <RowDefinition/>
    > > </Grid.RowDefinitions>
    > > <Rectangle Fill="sc#0.2, 1, 1, 1" RadiusX="10" RadiusY="10"
    > > HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    > > Margin="2.5,2.5,2.5,2.5" Width="Auto" Height="Auto" x:Name="Rectangle"
    > > IsEnabled="True">
    > > <Rectangle.Stroke><x:Null/></Rectangle.Stroke></Rectangle>
    > > <ContentPresenter HorizontalAlignment="Stretch" 
    > > VerticalAlignment="Stretch"
    > > x:Name="ContentPresenter" Content="{TemplateBinding Content}"
    > > ContentTemplate="{TemplateBinding ContentTemplate}" Margin="5,0,5,10"/>
    > >
    > > <TextBox HorizontalAlignment="Center" VerticalAlignment="Bottom"
    > > Margin="5,0,5,3.62655601659759" Height="18" Background="{x:Null}"
    > > x:Name="TextBox" Foreground="#FFFFFFFF" BorderBrush="{x:Null}" 
    > > Text="TextBox"
    > > TextWrapping="Wrap" Focusable="False" IsEnabled="True"/>
    > >
    > > </Grid>
    > > <ControlTemplate.Triggers>
    > > <Trigger Property="IsKeyboardFocused" Value="True"/>
    > > <Trigger Property="ToggleButton.IsChecked" Value="True"/>
    > > <Trigger Property="IsEnabled" Value="False"/>
    > > <Trigger Property="IsMouseOver" Value="True">
    > > <Setter Property="Shape.Stroke" Value="#FFF3F460" TargetName="Rectangle"/>
    > > <Setter Property="Shape.StrokeThickness" Value="2" 
    > > TargetName="Rectangle"/>
    > > </Trigger>
    > > <MultiTrigger>
    > > <MultiTrigger.Conditions>
    > > <Condition Property="IsPressed" Value="True"/>
    > > </MultiTrigger.Conditions>
    > > <Setter Property="Shape.Stroke" Value="sc#1, 0.8959832, 0.9053261,
    > > 0.116551772" TargetName="Rectangle"/>
    > > <Setter Property="Shape.StrokeThickness" Value="2" 
    > > TargetName="Rectangle"/>
    > > <Setter Property="Shape.Fill" TargetName="Rectangle">
    > > <Setter.Value>
    > > <RadialGradientBrush>
    > > <GradientStop Color="sc#0.5, 1, 1, 1" Offset="0"/>
    > > <GradientStop Color="sc#1, 0.2022265, 0.215518385, 0.7633134" Offset="1"/>
    > > </RadialGradientBrush>
    > > </Setter.Value>
    > > </Setter>
    > > </MultiTrigger>
    > > </ControlTemplate.Triggers>
    > > </ControlTemplate>
    > >
    > > Thanks very much for your help.
    > > -- 
    > > Don Baechtel 
    > 
    > 
    > 
    Tuesday, February 19, 2008 9:30 PM
  • By: Jen Rowe [MSFT]

    You can do this through the UI:
    -draw button the scene
    -edit a copy of its template
    -select the content presenter in the timelineview
    -go to properties palette and find the "Content" property of the Content
    Presenter
    -Right click the "Content Property" and select "Template Binding" off the
    menu
    -From the large menu that pops up, select the Tag property.

    NOTE: If you want to bind to a text box, try placing a grid + content
    presenter/text box within the template of the button. The grid helps as a
    button only supports having one child, and the grid can contain many.

    "dbaechtel" <dbaechtel@nospam.nospam> wrote in message
    news:CF8CDAD9-5618-4562-8C2A-D8160B5636DF@microsoft.com...
    > Your suggestion of adding Text="{TemplateBinding Property=Tag}" in the
    > TextBox worked just fine. THANKS!!!
    >
    > Is there going to be an easier way to do this without modifying the XAML
    > by
    > hand in the EID IDE eventually? It would be really nice if the Templated
    > controls could have easy access to the parent control's properties in the
    > IDE.
    >
    > --
    > Don Baechtel
    >
    >
    > "Jen Rowe [MSFT]" wrote:
    >
    >> You can just use the content presenters content property and bind it to
    >> the
    >> parent's tag property. If you want to use the Text box within the
    >> template
    >> you can also bind the Text Property of the text box to the Parent
    >> Content="{TemplateBinding Property=Tag}
    >> Text="{TemplateBinding Property=Tag}"
    >>
    >> See below for context:
    >>
    >> <Setter Property="Template">
    >> <Setter.Value>
    >> <ControlTemplate TargetType="{x:Type Button}">
    >>
    >>
    >> <!-- Content Presenter is where the text content etc is placed by
    >> the control -->
    >> <!-- The bindings are useful so that the control can be
    >> parameterized without editing the template -->
    >> <ContentPresenter HorizontalAlignment="{TemplateBinding
    >> HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"
    >> VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    >> RecognizesAccessKey="True" x:Name="contentPresenter" Width="88.042"
    >> Content="{TemplateBinding Property=Tag}"/>
    >> <TextBox HorizontalAlignment="Right" Margin="0,8,8,0"
    >> VerticalAlignment="Top" Width="67.979" Height="13.362"
    >> Text="{TemplateBinding Property=Tag}" TextWrapping="Wrap"/>
    >> </Grid>
    >>
    >>
    >> "dbaechtel" <dbaechtel@nospam.nospam> wrote in message
    >> news:3005FF5C-5BB4-4EB1-8422-62832D3FFF23@microsoft.com...
    >> >I have several Buttons in a WrapPanel that are derived from a
    >> >ControlTemplate
    >> > for the Buttons. The ControlTemplate contains a TextBox that serves as
    >> > a
    >> > label for the Buttons. I would like to use the Tag property(string) in
    >> > the
    >> > Button object as the Text for the TextBox label. In that way each
    >> > Button
    >> > can
    >> > get a specific label for the Button. Does anyone know how use the Tag
    >> > property of the Button object as the Text in the TextBox within the
    >> > Control
    >> > Template or a better way to do this in EID?
    >> >
    >> > Button XAML:
    >> > <Button HorizontalAlignment="Stretch" Width="70" Height="70"
    >> > x:Name="NewJog"
    >> > Background="sc#0.2, 0.876573265, 0.201642692, 0.201642692"
    >> > Template="{DynamicResource ButtonlTemplate1}" Style="{DynamicResource
    >> > ButtonStyle1}" Tag="New Job">
    >> > <Image x:Name="_4000_png" Source="4000.png"/>
    >> > </Button>
    >> >
    >> > ControlTemplate XAML:
    >> > <ControlTemplate x:Key="ButtonlTemplate1" TargetType="{x:Type
    >> > ButtonBase}">
    >> > <Grid x:Name="Grid">
    >> > <Grid.ColumnDefinitions>
    >> > <ColumnDefinition/>
    >> > </Grid.ColumnDefinitions>
    >> > <Grid.RowDefinitions>
    >> > <RowDefinition/>
    >> > </Grid.RowDefinitions>
    >> > <Rectangle Fill="sc#0.2, 1, 1, 1" RadiusX="10" RadiusY="10"
    >> > HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    >> > Margin="2.5,2.5,2.5,2.5" Width="Auto" Height="Auto" x:Name="Rectangle"
    >> > IsEnabled="True">
    >> > <Rectangle.Stroke><x:Null/></Rectangle.Stroke></Rectangle>
    >> > <ContentPresenter HorizontalAlignment="Stretch"
    >> > VerticalAlignment="Stretch"
    >> > x:Name="ContentPresenter" Content="{TemplateBinding Content}"
    >> > ContentTemplate="{TemplateBinding ContentTemplate}" Margin="5,0,5,10"/>
    >> >
    >> > <TextBox HorizontalAlignment="Center" VerticalAlignment="Bottom"
    >> > Margin="5,0,5,3.62655601659759" Height="18" Background="{x:Null}"
    >> > x:Name="TextBox" Foreground="#FFFFFFFF" BorderBrush="{x:Null}"
    >> > Text="TextBox"
    >> > TextWrapping="Wrap" Focusable="False" IsEnabled="True"/>
    >> >
    >> > </Grid>
    >> > <ControlTemplate.Triggers>
    >> > <Trigger Property="IsKeyboardFocused" Value="True"/>
    >> > <Trigger Property="ToggleButton.IsChecked" Value="True"/>
    >> > <Trigger Property="IsEnabled" Value="False"/>
    >> > <Trigger Property="IsMouseOver" Value="True">
    >> > <Setter Property="Shape.Stroke" Value="#FFF3F460"
    >> > TargetName="Rectangle"/>
    >> > <Setter Property="Shape.StrokeThickness" Value="2"
    >> > TargetName="Rectangle"/>
    >> > </Trigger>
    >> > <MultiTrigger>
    >> > <MultiTrigger.Conditions>
    >> > <Condition Property="IsPressed" Value="True"/>
    >> > </MultiTrigger.Conditions>
    >> > <Setter Property="Shape.Stroke" Value="sc#1, 0.8959832, 0.9053261,
    >> > 0.116551772" TargetName="Rectangle"/>
    >> > <Setter Property="Shape.StrokeThickness" Value="2"
    >> > TargetName="Rectangle"/>
    >> > <Setter Property="Shape.Fill" TargetName="Rectangle">
    >> > <Setter.Value>
    >> > <RadialGradientBrush>
    >> > <GradientStop Color="sc#0.5, 1, 1, 1" Offset="0"/>
    >> > <GradientStop Color="sc#1, 0.2022265, 0.215518385, 0.7633134"
    >> > Offset="1"/>
    >> > </RadialGradientBrush>
    >> > </Setter.Value>
    >> > </Setter>
    >> > </MultiTrigger>
    >> > </ControlTemplate.Triggers>
    >> > </ControlTemplate>
    >> >
    >> > Thanks very much for your help.
    >> > --
    >> > Don Baechtel
    >>
    >>
    >>

    Tuesday, February 19, 2008 9:31 PM