1

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>

enter image description here

As is shown, the button's tooltip is fixed.

enter image description here

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.

ɢʀᴜɴᴛ
  • 32,025
  • 15
  • 116
  • 110
Vincent
  • 3,124
  • 3
  • 21
  • 40

1 Answers1

1

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.

enter image description here

Nico Zhu
  • 32,367
  • 2
  • 15
  • 36