This is a migrated thread and some comments may be shown as answers.

RadPane Template Change

0 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 16 Apr 2012, 09:32 PM
I tried to change Header and Item Templates of RadPane to add a button which does Pin/Unpin functionality.
When I use it on individual RadPane Element, it works perfectly.
In my scenario, I need these same functionality wherever I use radpane across my application. It doesn't work if I create a style and access as a static resource.

Could you please help me in getting this resolved.

<telerik:RadPane.HeaderTemplate>
                    <DataTemplate>
                        <Border BorderBrush="#FF2C2B2B" BorderThickness="0" CornerRadius="5,5,0,0" Background="{StaticResource HeaderBrush}" Margin="-3,-5">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding}" Style="{StaticResource HeaderTextStyle}" Padding="5"/>
                                <telerik:RadButton x:Name="HeaderPinButton" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.Pin" Content="Pin"/>
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                     
                </telerik:RadPane.HeaderTemplate>
                <telerik:RadPane.TitleTemplate>
                    <DataTemplate>
                        <Border BorderBrush="#FF2C2B2B" BorderThickness="0" CornerRadius="5,5,0,0" Background="{StaticResource HeaderBrush}" Margin="-4,-2">
                            <StackPanel Orientation="Horizontal">
                               
                                <ContentPresenter Content="{Binding}" >
                                    <ContentPresenter.ContentTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding}" Style="{StaticResource HeaderTextStyle}" Padding="5" />
                                            <telerik:RadButton x:Name="HeaderUnPinButton" CommandParameter="{Binding SelectedPane, RelativeSource={RelativeSource TemplatedParent}}" Command="telerik:RadDockingCommands.Pin" Content="Unpin" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ContentPresenter.ContentTemplate>
                                </ContentPresenter>
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                </telerik:RadPane.TitleTemplate>


Thanks
Raki

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Rakesh
Top achievements
Rank 1
Share this question
or