RibbonView command

2 posts, 0 answers
  1. Wang
    Wang avatar
    42 posts
    Member since:
    Oct 2011

    Posted 06 Nov Link to this post

    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?

  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 09 Nov Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top