Volume Control
Application-specific hotkeys for Windows
VolumeControl.Core.ITemplateDictionaryProvider Interface Reference

An alternative to ITemplateProvider that can be combined with a ResourceDictionary (with a codebehind) to define many data templates in XAML and provide them for action settings based on a key string and/or value type.

XAML-defined data templates must be type ActionSettingDataTemplate, not DataTemplate.
Set ActionSettingDataTemplate.ValueType to the type of value that the data template supports. More...

Inheritance diagram for VolumeControl.Core.ITemplateDictionaryProvider:
Collaboration diagram for VolumeControl.Core.ITemplateDictionaryProvider:

Public Member Functions

ActionSettingDataTemplateProvideDataTemplate (string key)
 Provides the ActionSettingDataTemplate instance with the specified key . More...
 
ActionSettingDataTemplateProvideDataTemplate (Type valueType)
 Provides an ActionSettingDataTemplate for the specified valueType . More...
 
IEnumerable< DictionaryEntry > AsEnumerable ()
 Gets the contents of the dictionary as an enumerable collection of DictionaryEntry instances. More...
 

Detailed Description

An alternative to ITemplateProvider that can be combined with a ResourceDictionary (with a codebehind) to define many data templates in XAML and provide them for action settings based on a key string and/or value type.

XAML-defined data templates must be type ActionSettingDataTemplate, not DataTemplate.
Set ActionSettingDataTemplate.ValueType to the type of value that the data template supports.

Any public, non-static, non-abstract class that implements this interface can be specified for HotkeyActionSettingAttribute.DataTemplateProviderType.

Member Function Documentation

◆ AsEnumerable()

IEnumerable<DictionaryEntry> VolumeControl.Core.ITemplateDictionaryProvider.AsEnumerable ( )

Gets the contents of the dictionary as an enumerable collection of DictionaryEntry instances.

Returns
An enumerable collection of all of the DictionaryEntry pairs in this instance.

Implemented in VolumeControl.Core.ResourceDictionaryTemplateProvider.

◆ ProvideDataTemplate() [1/2]

ActionSettingDataTemplate? VolumeControl.Core.ITemplateDictionaryProvider.ProvideDataTemplate ( string  key)

Provides the ActionSettingDataTemplate instance with the specified key .

Parameters
keyThe key name of the target DataTemplate instance.
Returns
DataTemplate instance with the specified key if it exists; otherwise null.

Implemented in VolumeControl.Core.ResourceDictionaryTemplateProvider.

◆ ProvideDataTemplate() [2/2]

ActionSettingDataTemplate? VolumeControl.Core.ITemplateDictionaryProvider.ProvideDataTemplate ( Type  valueType)

Provides an ActionSettingDataTemplate for the specified valueType .

This method will not return templates where ActionSettingDataTemplate.IsExplicit is true.

Parameters
valueTypeThe value type to get a DataTemplate for.
Returns
An ActionSettingDataTemplate instance for the specified valueType if one was found; otherwise null.

Implemented in VolumeControl.Core.ResourceDictionaryTemplateProvider.


The documentation for this interface was generated from the following file: