Schedule / Commanding / Command Bars / Schedule Command Bars Overview
In This Topic
    Schedule Command Bars 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 command bars interface (menu and toolbars). There are two ways to create command bars associated with a schedule view:

     Schedule View with Command Bars Control

    If you are not creating a cross-platform application, the easiest way to create a schedule view with command bars is to use the Visual Studio designer and drop an NScheduleViewWithCommandBarsControl from the Visiual Studio toolbox to your form/window. Check out the Schedule Command Bars Designer topic for more information on how to use the Visual Studio designer to customize the schedule command bars.

    Alternatively, you can use the NScheduleViewWithCommandBars class to add a schedule view with command bars to your form/window programatically. The example below demonstrates how to create a schedule view with command bars 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 command bars
    Copy Code
    NScheduleViewWithCommandBars commandBarsUI = new NScheduleViewWithCommandBars(); // Create a schedule view with command bars
    NScheduleView scheduleView = ribbonUI.View; // Get the schedule view
    
    // Create a NOV widget host that hosts the schedule view with command bars
    NNovWidgetHost<NWidget> novHost = new NNovWidgetHost<NWidget>(commandBarsUI);
    
     Schedule Command Bar Builder

    NOV Schedule provides a command bar builder that can be used to create some menus and toolbars to control and edit the schedule and its appointments. This builder is represented by the class NScheduleCommandBarBuilder.

    The easiest way to create a schedule view with command bars (menus and toolbars) is to use the NScheduleViewViewWithCommandBars class. The example below demonstrates how to create a schedule view with command bars 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 Command Bars
    Copy Code
    NNovWidgetHost<NScheduleViewWithCommandBars> novContent = new NNovWidgetHost<NScheduleViewWithCommandBars>();
    

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

    Create Command Bars UI
    Copy Code
    NScheduleCommandBarBuilder commandBarBuilder = new NScheduleCommandBarBuilder();
    NWidget uiWidget = commandBarBuilder.CreateUI(scheduleView);
    
    See Also