Tooltips/Contextmenus do not exist in XAML Visual Tree and so cannot access DataContext so bindings will fail.


Workaround is to create a proxy Tooltip outside of the tooltip itself and then reference it within Tooltip using a ContentPresenter:


    <Button
        x:Name="IconBtn"
        Command="{Binding Command, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type local:Button_Primary_Icon}}}"
        Style="{StaticResource Button_Primary}">

        <Button.Resources>
            <!--  Proxy required because Tooltips are not in XAML visual tree and cannot access datacontext. Define the tooltip here and then reference within the Tooltips Content Presenter  -->
            <TextBlock
                x:Key="ToolTipProxy"
                FontSize="{StaticResource FontSize_14}"
                Foreground="{StaticResource White}"
                Text="{Binding RelativeSource={RelativeSource AncestorType=local:Button_Primary_Icon}, Path=ToolTipText}" />
        </Button.Resources>

        <Button.ToolTip>
            <ToolTip
                x:Name="Button_Primary_Tooltip"
                DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}"
                Style="{DynamicResource EditUserUITooltip}">
                <StackPanel
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Orientation="Vertical">

                    <ContentPresenter Content="{DynamicResource ToolTipProxy}" />

                </StackPanel>
            </ToolTip>
        </Button.ToolTip>
    </Button>


See https://stackoverflow.com/questions/62048541/binding-tooltip-in-usercontrol?rq=1 for further info.