I'm designing a InkToolbar with InkToolbarCustomToolButton, like below
<InkToolbar x:Name="inkToolbar1" x:FieldModifier="Public" Grid.Column="0" Grid.RowSpan ="2" Grid.ColumnSpan="2" InitialControls="None" TargetInkCanvas="{x:Bind inkCanvas}" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
<InkToolbarCustomToolButton x:Name="toggleButtonNewInk" Click="toggleButtonNewInk_Click">
<SymbolIcon Symbol="Page2" ToolTipService.ToolTip="NewInk"/>
</InkToolbarCustomToolButton>
</InkToolbar>
As is shown, the button's tooltip is fixed.
Now I want to show in different languages, using Resources.resw.
For example, you can set a button's content using Resources.resw.
How can I do in the same way?
By the way, I don't want to use PointerEntered event.
For your requirement, you could set the Content
of ToolTip
just like button that you have mentioned.
<InkToolbarCustomToolButton x:Name="toggleButtonNewInk" Click="toggleButtonNewInk_Click" Margin="20">
<SymbolIcon Symbol="Page2" >
<ToolTipService.ToolTip>
<ToolTip Content="" x:Uid="ToolTip"/>
</ToolTipService.ToolTip>
</SymbolIcon>
</InkToolbarCustomToolButton>
And then set the different value for ToolTip
in different resources file like the following:
en-US
<data name="ToolTip.Content" xml:space="preserve">
<value>NewInk</value>
<comment>Prompt the user this is a new ink button</comment>
</data>
zh-CN
<data name="ToolTip.Content" xml:space="preserve">
<value>新画笔</value>
<comment>提示用户这是一个新画笔按钮</comment>
</data>
For more, please refer to Put UI strings into resources.