Version

QatPlaceholderToolType Enumeration

Identifies the type of object that the QatPlaceholderTool represents on the QuickAccessToolbar
Syntax
'Declaration
 
Public Enum QatPlaceholderToolType 
   Inherits System.Enum
public enum QatPlaceholderToolType : System.Enum 
Members
MemberDescription
RibbonGroupThe QatPlaceholderTool represents a placeholder for a RibbonGroup.
ToolThe QatPlaceholderTool represents a placeholder for a tool (IRibbonTool).
Example
QatPlaceholderTool Target property

' Creating ButtonTool 
Dim btnToolCopy As New ButtonTool() 
btnToolCopy.Id = "copyTool" 
AddHandler btnToolCopy.Click, AddressOf btnToolCopy_Click 

' Adding ButtonTool to the QAT 
Dim qatToolCopy As New QatPlaceholderTool() 
qatToolCopy.TargetId = "copyTool" ' btnToolCopy.Id 
qatToolCopy.TargetType = QatPlaceholderToolType.Tool 
xamRibbon.QuickAccessToolbar.Items.Add(qatToolCopy) 
...
Private Sub btnToolCopy_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) 
    Dim btnTool As ButtonTool = TryCast(sender, ButtonTool) 
    Dim qatTool As QatPlaceholderTool = TryCast(btnTool.Parent, QatPlaceholderTool) 
    
    If qatTool Is Nothing Then 
        Debug.Write("The tool is not on the QuickAccessToolbar") 
    Else 
        Debug.Write("qatTool.Target: " + qatTool.Target) 
    End If 
End Sub
// Creating ButtonTool
ButtonTool btnToolCopy = new ButtonTool();
btnToolCopy.Id = "copyTool";
btnToolCopy.Click += new RoutedEventHandler(btnToolCopy_Click);

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

void btnToolCopy_Click(object sender, RoutedEventArgs e)
{
    ButtonTool btnTool = sender as ButtonTool;
    QatPlaceholderTool qatTool = btnTool.Parent as QatPlaceholderTool;

    if (qatTool == null)
        Debug.Write("The tool is not on the QuickAccessToolbar");
    else
        Debug.Write("qatTool.Target: "+qatTool.Target);
}
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