public override void Initialize() { base.Initialize(); // Add the custom command action to the drawing view's commander m_DrawingView.Commander.Add(new CustomCommandAction()); // Rename the "Home" ribbon tab page NRibbonTabPageBuilder homeTabBuilder = m_RibbonBuilder.TabPageBuilders[NDiagramRibbonBuilder.TabPageHomeName]; homeTabBuilder.Name = "Start"; // Rename the "Text" ribbon group of the "Home" tab page NRibbonGroupBuilder fontGroupBuilder = homeTabBuilder.RibbonGroupBuilders[NHomeTabPageBuilder.GroupTextName]; fontGroupBuilder.Name = "Custom Name"; // Remove the "Clipboard" ribbon group from the "Home" tab page homeTabBuilder.RibbonGroupBuilders.Remove(NHomeTabPageBuilder.GroupClipboardName); // Insert the custom ribbon group at the beginning of the home tab page homeTabBuilder.RibbonGroupBuilders.Insert(0, new CustomRibbonGroupBuilder()); // Remove the drawing view from its parent and recreate the UI m_DrawingView.ParentNode.RemoveChild(m_DrawingView); m_ExampleTabPage.Content = m_RibbonBuilder.CreateUI(m_DrawingView); }
public override void Initialize() { base.Initialize(); // Add the custom command action to the schedule view's commander m_ScheduleView.Commander.Add(new CustomCommandAction()); // Rename the "Home" ribbon tab page NRibbonTabPageBuilder homeTabBuilder = m_RibbonBuilder.TabPageBuilders[NScheduleRibbonBuilder.TabPageHomeName]; homeTabBuilder.Name = "Start"; // Rename the "Font" ribbon group of the "Home" tab page NRibbonGroupBuilder fontGroupBuilder = homeTabBuilder.RibbonGroupBuilders[NHomeTabPageBuilder.GroupViewName]; fontGroupBuilder.Name = "Look"; // Remove the "Editing" ribbon group from the "Home" tab page homeTabBuilder.RibbonGroupBuilders.Remove(NHomeTabPageBuilder.GroupEditingName); // Insert the custom ribbon group at the beginning of the home tab page homeTabBuilder.RibbonGroupBuilders.Insert(0, new CustomRibbonGroupBuilder()); // Remove the schedule view from its parent and recreate the UI m_ScheduleView.ParentNode.RemoveChild(m_ScheduleView); m_ExampleTabPage.Content = m_RibbonBuilder.CreateUI(m_ScheduleView); }