SL2.0 - Can't use a TextBox after having customized it.
--- This post has already been posted in the "Design" forum... but it seems it was nor the right place - Sorry posting it 2 times---
Hi all,
I'm working on Customizing Silverlight Controls. I would like to Set all my TextBox with :
But it seems we can't set a specific radius to a TextBox.
So I've done the following ControlTemplate :
<
Style TargetType="TextBox" x:Key="_STYL_TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid>
<Rectangle Width="90" Height="20" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="3" RadiusY="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.504,0.483" StartPoint="0.504,-0.4">
<GradientStop Color="#FFB4DDFF" Offset="0.524"/>
<GradientStop Color="#FFFCFCFC" Offset="1"/>
<GradientStop Color="#FFDDEEFD" Offset="0.688"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBox Text="{TemplateBinding Text}" Width="Auto" Height="Auto" Margin="0,0,0,0" BorderThickness="0,0,0,0" Background="#00FFFFFF" FontSize="12"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>But we I want to apply it to my text box,
<
TextBox x:Name="_TBX_Test" Style="{StaticResource _STYL_TextBox}" Text="Eric" Canvas.Top="10" Canvas.Left="10" />
I can't type-in anything in my textbox...
It seems I could do something setting completly the Template... but I don't want to redefine completly a tesbox for a simple border...
thanks for your help,
Eric.