Nevron Open Vision Documentation
Schedule / Commanding / Ribbon / Schedule Ribbon Overview
In This Topic
    Schedule Ribbon Overview
    In This Topic

    NOV Schedule provides a lot of commands and settings most of which can be shown to the end user in a ribbon interface. There are two ways to create a ribbon associated with a schedule view:

     Schedule View with Ribbon Control

    The easiest way to create a schedule view with ribbon is to use the Visual Studio designer and drop an NScheduleViewWithRibbonControl from the Visiual Studio toolbox to your form/window. Check out the Schedule Ribbon Designer topic for more information on how to use the Visual Studio designer to customize the schedule ribbon.

    Alternatively, you can use the NScheduleViewWithRibbon class to add a schedule view with ribbon to you form/window programatically. The example below demonstrates how to create a schedule view with ribbon hosted in a NOV widget host. You can then add this host to a form's Controls collection if you are creating a WinForms application, set it as the Content of a WPF window in a WPF application project or to the ContentView of a Xamarin.Mac window.

    Create a schedule view with ribbon
    Copy Code
    NScheduleViewWithRibbon ribbonUI = new NScheduleViewWithRibbon(); // Create a schedule view with a ribbon
    NScheduleView scheduleView = ribbonUI.View; // Get the schedule view
    
    // Create a NOV widget host that hosts the schedule view with ribbon
    NNovWidgetHost<NWidget> novHost = new NNovWidgetHost<NWidget>(ribbonUI);
    
     Schedule Ribbon Builder

    NOV Schedule provides a ribbon builder that can be used to create and associate ribbon commanding UI to a schedule view. The builder is represented by the NScheduleRibbonBuilder class.

    The easiest way to create a schedule view with ribbon is to use the NScheduleViewWithRibbon class. The example below demonstrates how to create a schedule view with ribbon hosted in a NOV widget host. You can then add this host to a form's Controls collection if you are creating a WinForms application, set it as the Content of a WPF window in a WPF application project or to the ContentView of a Xamarin.Mac window.

    Create a Schedule View with Ribbon
    Copy Code
    NNovWidgetHost<NScheduleViewWithRibbon> novContent = new NNovWidgetHost<NScheduleViewWithRibbon>();
    

    Another way to create a ribbon based commanding UI and associate it with a schedule view is:

    Create Ribbon UI
    Copy Code
    NScheduleRibbonBuilder ribbonBuilder = new NScheduleRibbonBuilder();
    NWidget uiWidget = ribbonBuilder.CreateUI(scheduleView);
    

    To rename a ribbon tab or a ribbon group command builder, change it's name property prior to using it for building the ribbon UI. The following piece of code demonstrates how to rename the "Home" tab page and the "Font" ribbon group:

    Rename ribbon tab and group
    Copy Code
    // Rename the "Home" ribbon tab page
    NRibbonTabPageBuilder homeTabBuilder = m_RibbonBuilder.TabPageBuilders[NScheduleRibbonBuilder.TabPageHomeName];
    homeTabBuilder.Name = "Start";
    
    // Rename the "View" ribbon group of the "Home" tab page
    NRibbonGroupBuilder fontGroupBuilder = homeTabBuilder.RibbonGroupBuilders[NHomeTabPageBuilder.GroupViewName];
    fontGroupBuilder.Name = "Look";
    
    See Also