Version

TargetId Property

Returns/sets the string RibbonToolHelper.IdProperty of the tool or RibbonGroup associated with this QatPlaceholderTool depending upon the TargetType property.
Syntax
'Declaration
 
Public Property TargetId As String
public string TargetId {get; set;}
Remarks

Depending on the value of the TargetType property, setting this property to the RibbonToolHelper.IdProperty of a tool or RibbonGroupthat has been defined somewhere on the XamRibbon causes a clone of that object to be created and displayed inside this QatPlaceholderTool.

Tools can be added to QuickAccessToolbar by the end user (via the right click context menu provided for each tool) or by the developer (by adding a QatPlaceholderTool that references the Id of a tool). RibbonGroups can be added to the QuickAccessToolbar by the end user by right clicking on the caption of the RibbonGroup in a RibbonTabItem.

Example
QatPlaceholderTool TargetId property

' Creating ButtonTool
Dim btnToolCopy As New ButtonTool()
 btnToolCopy.Id = "copyTool"

' Adding ButtonTool to the QAT
Dim qatToolCopy As New QatPlaceholderTool()
qatToolCopy.TargetId = "copyTool"
' btnToolCopy.Id
qatToolCopy.TargetType = QatPlaceholderToolType.Tool
xamRibbon.QuickAccessToolbar.Items.Add(qatToolCopy)
// Creating ButtonTool
ButtonTool btnToolCopy = new ButtonTool();
btnToolCopy.Id = "copyTool";

// Adding ButtonTool to the QAT
QatPlaceholderTool qatToolCopy = new QatPlaceholderTool();
qatToolCopy.TargetId = "copyTool"; // btnToolCopy.Id
qatToolCopy.TargetType = QatPlaceholderToolType.Tool;
xamRibbon.QuickAccessToolbar.Items.Add(qatToolCopy);
<igRibbon:XamRibbon.QuickAccessToolbar>
    
<igRibbon:QuickAccessToolbar>
        
<igRibbon:QatPlaceholderTool TargetId="undoTool" TargetType="Tool"></igRibbon:QatPlaceholderTool>
        
<igRibbon:QatPlaceholderTool TargetId="redoTool"></igRibbon:QatPlaceholderTool>
        
<igRibbon:QatPlaceholderTool TargetId="copyTool"></igRibbon:QatPlaceholderTool>
        
<igRibbon:QatPlaceholderTool TargetId="cutTool" ></igRibbon:QatPlaceholderTool>
        
<igRibbon:QatPlaceholderTool TargetId="Text Style" TargetType="RibbonGroup"></igRibbon:QatPlaceholderTool>
    
</igRibbon:QuickAccessToolbar>
</igRibbon:XamRibbon.QuickAccessToolbar>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also