-
Notifications
You must be signed in to change notification settings - Fork 19
Working with EventLogger
!Note:
Only available since Windows 8.
Since Windows 8 the Windows Ribbon framework provides developers an event logging mechanism.
From an instance of the Ribbon class you can get an instance of the EventLogger class which implements the COM IUIEventLogger Interface (Property EventLogger). If you want to use the EventLogger, you have to call EventLogger.Attach() and connect to the EventLogger.LogEvent. If you don't want the logging anymore, then you have to call EventLogger.Detach(). See also Listening for Ribbon Events.
Methods
Name | Description |
---|---|
Attach() | Attach to an IUIEventLogger and IUIEventingManager objects events |
Detach() | Detach the log events |
Events
Name | Description |
---|---|
LogEvent | Occurs when a new Log Event is delivered by the Ribbon Framework |
In your EventHandler for the LogEvent you get the EventLoggerEventArgs class.
Properties
Name | Description |
---|---|
CommandID | The ID of the Command directly related to the event, which is specified in the markup resource file (Type: UInt32). |
CommandName | The Command name that is associated with CommandId (Type: string). |
EventType | Identifies the types of events associated with a Ribbon (Type: EventType). |
Modes | The application modes. Only used when a EventType ApplicationModeSwitched has been fired. In all other cases it is set to 0. (Type: Int32) |
Location | Identifies the locations where events associated with a Ribbon control can originate. (Type: EventLocation) |
ParentCommandID | The ID for the parent of the Command, which is specified in the markup resource file.(Type: UInt32) |
ParentCommandName | The Command name of the parent that is associated with CommandId.(Type: string) |
SelectionIndex | SelectionIndex is used only when a EventType CommandExecuted has been fired in response to the user selecting an item within a ComboBox or item gallery. In those cases, SelectionIndex contains the index of the selected item. In all other cases, it is set to 0. (Type: UInt32) |
Example:
Ribbon.EventLogger.LogEvent += DiagnosticLog;
Ribbon.EventLogger.Attach();
...
...
Ribbon.EventLogger.Detach();
Ribbon.EventLogger.LogEvent -= DiagnosticLog;
private void DiagnosticLog(object sender, EventLoggerEventArgs e)
{
switch (e.EventType){
case EventType.CommandExecuted:
uint id = e.CommandID;
...
break;
case EventType.TabActivated:
...
break;
}
}
-
Basics
- Introduction, Background on the windows ribbon
- Basic Ribbon Wrapper Basic .NET wrappers for windows ribbon.
- Quickstart Tutorial
- First WinForms Ribbon Application How to create an empty WinForms application with ribbon support.
-
Working with Ribbon Controls
- Application Menu with Buttons How to use the ribbon application menu.
- Application Menu with SplitButton and DropDownButton How to use the ribbon application menu with ribbon split button and ribbon dropdown button controls.
- Tabs, Groups and HelpButton How to use ribbon tabs, groups and the ribbon help button control.
- Spinner How to use the ribbon spinner control.
- ComboBox How to use the ribbon combo box control.
- DropDownGallery, SplitButtonGallery and InRibbonGallery How to use the ribbon drop down gallery, split button gallery and in ribbon gallery controls.
- CheckBox and ToggleButton How to use the ribbon check box and toggle button controls.
- DropDownColorPicker How to use the ribbon drop down color picker control.
- FontControl How to use the ribbon font control.
- ContextualTabs How to work with ribbon contextual tabs.
- ContextPopup How to work with ribbon context popup.
- RecentItems How to work with ribbon recent items control.
- QuickAccessToolbar How to work with the ribbon quick access toolbar.
- The Ribbon Class How to work with the ribbon class. Methods, Properties, Events
- EventLogger Since Windows 8: Logging ribbon events
- UICollectionChangedEvent How to work with the ChangedEvent in an IUICollection
-
Working with miscellany Ribbon features
- ApplicationModes How to work with ribbon application modes.
- SizeDefinition How to define custom size definitions for ribbon group elements.
- Localization How to localize a ribbon.
- Changing Ribbon Colors How to change the ribbon colors.
- Working with Images How to work with images in the ribbon.
- Use Ribbon as External DLL How to load ribbon resources from external DLLs.
- Wrapper class RibbonItems An auto generated wrapper class from the ribbon markup.
-
Designing, building, previewing Windows Ribbon with RibbonTools
- RibbonTools basics Settings, Command line, ...
- Create a new project Create a WordPad sample project
- Preview the Ribbon
- Specifying Ribbon Commands
- Designing Ribbon Views
- Convert Images to Alpha Bitmaps
-
Modeling Guidelines
-
How to ...