# Other .NET Programming > Windows Presentation Foundation (WPF) & XAML forum >  ControlTemplate - Border set CornerRadius

## marco.morgia

Hi,

I've a content control with a Border inside. I have to use this control to make different corner radius in a toggle button control (only left corner, center and right corner). To do this I've make 3 differente controltemplate because the CornerRadius of border don't accept a TemplateBinding for that.

It's possible to make an unique controltemplate and passing the corner radius as TemplateBinding? 

Thanks

----------


## sanjay.vaniya

<Window.Resources>


        <Style x:Key="TabButton" TargetType="Button">
            <Setter Property="TextBlock.TextAlignment" Value="Center" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding Background}"
                            BorderThickness="0,1,1,0"
                            CornerRadius="{TemplateBinding Border.CornerRadius}">
                            <ContentPresenter
                                x:Name="contentPresenter"
                                Margin="{TemplateBinding Padding}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style
            x:Key="TabButtonFirst"
            BasedOn="{StaticResource TabButton}"
            TargetType="Button">
            <Setter Property="Border.CornerRadius" Value="15,0,0,0" />
        </Style>

        <Style
            x:Key="TabButtonLast"
            BasedOn="{StaticResource TabButton}"
            TargetType="Button">
            <Setter Property="Border.CornerRadius" Value="0,0,0,15" />
        </Style>
    </Window.Resources>
    <StackPanel>

        <Button
            Width="200"
            Height="30"
            Content="test" Style="{StaticResource TabButtonFirst}"/>
        <Button
            Width="200"
            Height="30"
            Content="test" Style="{StaticResource TabButtonLast}"/>
    </StackPanel>

----------

