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

RibbonView command

1 Answer 87 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Wang
Top achievements
Rank 1
Wang asked on 07 Nov 2016, 04:55 AM

Hello,

I have a problem when using diagram in ribbonview,

I want to set the 'New','Open','Save' button of the firstlook demo to the RadRibbonBackstage, the code is:

<telerik:RadRibbonView.ApplicationButtonContent>
                <TextBlock Text="Begin" Margin="10 2" />
</telerik:RadRibbonView.ApplicationButtonContent>

<telerik:RadRibbonView.Backstage>
                <telerik:RadRibbonBackstage>
                    <telerik:RadRibbonBackstageItem Header="New" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/new32.png" Command="telerik:DiagramCommands.Clear"
CommandTarget="{Binding ElementName=diagram}"/>
                    <telerik:RadRibbonBackstageItem Header="Open" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/open32.png" Command="telerik:DiagramCommands.Open" 
CommandTarget="{Binding ElementName=root}"/>
                    <telerik:RadRibbonBackstageItem Header="Save" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/save32.png" Command="telerik:DiagramCommands.Save"
CommandTarget="{Binding ElementName=root}" />
                </telerik:RadRibbonBackstage>
            </telerik:RadRibbonView.Backstage>

There are two problem:

1.the open and save command did not work.

2.when the window loaded,if I click the "Begin" button, the RadRibbonBackstageItems is not enabled,but when I click the digram,and click the "Begin" button, the RadRibbonBackstageItems is enabled.

what should I do?

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 09 Nov 2016, 04:44 PM
Hello Wang,

You should register the command bindings of RadDiagram as demonstrated in the examples from the Serialization article.

In order to enable the buttons in RibbonView, the diagram should be focused. You can call the Focus() method of RadDiagram in the constructor of the window. This will ensure that the control is focused and the buttons are enabled.

Hope this helps.

Regards,
Tanya
Telerik by Progress
Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Tags
Diagram
Asked by
Wang
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or