Show toolbar in Raddocking floating/undocked pane in WPF

1 Answer 104 Views
Docking RibbonView and RibbonWindow
Ashvini
Top achievements
Rank 1
Ashvini asked on 07 Sep 2021, 09:50 AM | edited on 07 Sep 2021, 10:21 AM

How to display Radribbon or Toolbar in Raddocking undocked tool window.

i want to display toolbar for undocked wibdow and in case of docked window display same toolbar in Mainwindow.

 

how to implement this?

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 09 Sep 2021, 10:29 AM

Hello Ashvini,

Correct me if I am wrong, but a RadToolbar control needs to be shown, only if the pane is undocked? And if the pane is not floating, only the toolbar of the MainWindow should be visible? 

If that is the case, you can set a RadToolbar control inside the desired pane and then create a custom style to check the floating state of the pane. The following code snippets show the mentioned style:

<Style x:Key="visibilityStyle" TargetType="telerik:RadToolBar">
    <Style.Triggers>
        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=telerik:RadPane}, Path=IsFloating}" Value="False">
            <Setter Property="Visibility" Value="Collapsed"/>
        </DataTrigger>
    </Style.Triggers>
</Style>
Since the RadToolbar control is inside of the pane, the Visibility property will change depending on the IsFloating property of the pane. Then set the style to the toolbar as follows:
<telerik:RadToolBar Style="{StaticResource visibilityStyle}"/>

That said, I have prepared a sample project implementing this approach. Please let me know if this works for you or if I have misunderstood your requirement in any way.

Regards,
Stenly
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Ashvini
Top achievements
Rank 1
commented on 13 Sep 2021, 10:53 AM | edited

Actually i am working on MVVM pattern so there are seperate controls.
Stenly
Telerik team
commented on 16 Sep 2021, 09:58 AM

Could you edit the provided sample project to match your current scenario, so I can try to present a more proper solution?
Tags
Docking RibbonView and RibbonWindow
Asked by
Ashvini
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or