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

TitleTemplate being shared among docked panes?

1 Answer 52 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Bradley
Top achievements
Rank 1
Bradley asked on 03 Aug 2011, 03:43 PM
I have a RadSplitContainer with a RadPaneGroup inside of it.  Inside the pane group are 4 RadPane's (they are tabbed together into the same pane group), two of which have a titletemplate assigned to them.  The titletemplate contains a button that when clicked drops down a contextmenu displaying 5 colored rectangles.  The purpose of this is to link certain windows together.  This works 100% when the 4 panes aren't tabbed together (either floating or docked elsewhere).  However, if they are tabbed together and I change the button on one of the panes from the blue rectangle to the orange rectangle, it also changes the button on the other pane in the tab group, so it seems like if panes are tabbed together they share a TitleTemplate.  Here's my code for the TitleTemplate

<DataTemplate x:Key="TitleTemplate" x:Name="TTemplate">
     <StackPanel Orientation="Horizontal">           
         <ContentPresenter Content="{Binding}"
                     Margin="0,0,2,0" />
         <Button x:Name="btnActions" Height="20" Width="20" BorderThickness="0" Style="{x:Null}">
             <Button.Content>
                 <Rectangle x:Name="rect" Fill="Blue" Width="15" Height="15" />
             </Button.Content>
             <telerik:RadContextMenu.ContextMenu>
                 <telerik:RadContextMenu EventName="Click" ItemClick="RadContextMenu_ItemClick">
                     <telerik:RadMenuItem Tag="blue">
                         <telerik:RadMenuItem.Header>
                             Blue Symbol Bind
                         </telerik:RadMenuItem.Header>
                         <telerik:RadMenuItem.Icon>
                             <Rectangle Fill="Blue" Width="15" Height="15" />
                         </telerik:RadMenuItem.Icon>
                     </telerik:RadMenuItem>
                     <telerik:RadMenuItem Tag="orange">
                         <telerik:RadMenuItem.Header>
                             Orange Symbol Bind
                         </telerik:RadMenuItem.Header>
                         <telerik:RadMenuItem.Icon>
                             <Rectangle Fill="Orange" Width="15" Height="15" />
                         </telerik:RadMenuItem.Icon>
                     </telerik:RadMenuItem>
                     <telerik:RadMenuItem Tag="red">
                         <telerik:RadMenuItem.Header>
                             Red Symbol Bind
                         </telerik:RadMenuItem.Header>
                         <telerik:RadMenuItem.Icon>
                             <Rectangle Fill="Red" Width="15" Height="15" />
                         </telerik:RadMenuItem.Icon>
                     </telerik:RadMenuItem>
                     <telerik:RadMenuItem Tag="gray">
                         <telerik:RadMenuItem.Header>
                             Gray Symbol Bind
                         </telerik:RadMenuItem.Header>
                         <telerik:RadMenuItem.Icon>
                             <Rectangle Fill="Gray" Width="15" Height="15" />
                         </telerik:RadMenuItem.Icon>
                     </telerik:RadMenuItem>
                     <telerik:RadMenuItem Tag="yellow">
                         <telerik:RadMenuItem.Header>
                             Yellow Symbol Bind
                         </telerik:RadMenuItem.Header>
                         <telerik:RadMenuItem.Icon>
                             <Rectangle Fill="Yellow" Width="15" Height="15" />
                         </telerik:RadMenuItem.Icon>
                     </telerik:RadMenuItem>
                 </telerik:RadContextMenu>
             </telerik:RadContextMenu.ContextMenu>
         </Button></StackPanel>
 </DataTemplate>

Any help is appreciated, thanks!

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 05 Aug 2011, 10:07 AM
Hello Bradley,

I don't think the attached code is enough to understand where is the issue in your application and RadDocking since I don't know how do you apply the change after the menu click however I have attached an example to show how you could use a context menu to change the header of a RadPane. Please note that in the attache project I set the Header to the picked color however in your you could create a complex object that would have Brush Color and String Title properties and change the color but preserve the text or something like that. The Fill will bind to {Binding Color} and the TextBlock to {Binding Title} in that case.

I hope the attached project would work fine for you.

Regards,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Tags
Docking
Asked by
Bradley
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or