在UWP的资源字典中使用TooltipService.Tooltip关键字 [英] Using TooltipService.Tooltip Keyword in a Resource Dictionary for UWP
问题描述
Hi,
我正在通过x:UID属性翻译我的UWP应用程序。
I'm translating my UWP app via x: UID property like this.
代码(XAML):
Code (XAML):
<NavigationViewItem x:Name="Assistant_Mode" x:Uid="Assistant_Header" Content="Asistan modu" Tag="assistant" ToolTipService.ToolTip="Asistan modu." FontFamily="Segoe UI">
资源词典记录:
Resource Dictionary record:
Assistant_Header.Content:Asistan modu
现在,我想通过资源字典翻译ToolTipService.ToolTip但是此键盘在词典中不起作用:
Now, I want translate the ToolTipService.ToolTip via Resource dictionary but this keyboard is not work in Dictionary:
Assistant_Header.ToolTipService.ToolTip:Asistan modu
我可以在资源字典中转换工具提示吗?谢谢。
Can I transalte a Tooltip in a Resource Dictionary ? Thanks.
推荐答案
Hello berk_b,
Hello berk_b,
可能直接设置ToolTipService.ToolTip附加属性是不可能的。因此,如果您想通过resw文件进行管理,则需要寻求其他方式。
Probably, it's impossible to set ToolTipService.ToolTip attached property directly. So if you'd like to manage it through resw file, you would need to seek another way.
例如
1。以XAML元素形式指定ToolTipService.ToolTip。并在其中放入一个TextBlock。
1. Specify ToolTipService.ToolTip in XAML element form. And put a TextBlock in it.
<NavigationViewItem x:Name="Assistant_Mode" x:Uid="Assistant_Header" Content="Asistan modu" Tag="assistant" FontFamily="Segoe UI">
<ToolTipService.ToolTip>
<TextBlock x:Uid="Assistant_Header_ToolTip" Text="Asistan modu."/>
</ToolTipService.ToolTip>
</NavigationViewItem>
2。然后在resw文件中单独定义工具提示的内容(TextBlock.Text)。
2. Then define the tooltip's content (TextBlock.Text) separately in resw file.
Assistant_Header_ToolTip.Text:Asistan modu
这篇关于在UWP的资源字典中使用TooltipService.Tooltip关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!