Silverlight工具提示词是相反的

时间:2014-09-08 18:03:02

标签: silverlight grid tooltip

由于某种原因,silverlight中的工具提示正在反转显示的文本。

这是代码

            // Create the colored rectangle
            Rectangle rect = new Rectangle();

            // Set the grid row and column
            Grid.SetRow(rect, i);
            Grid.SetColumn(rect, 0);

            // Set the rectangle into the UI
            LegendColorGrid.Children.Add(rect);

            // Create the tooltip for the item
            ToolTip tip = new ToolTip();
            tip.Content = contentList[i].UnitLabel;
            tip.Placement = System.Windows.Controls.Primitives.PlacementMode.Right;
            tip.PlacementTarget = rect;

            // Set the tooltip into the UI
            ToolTipService.SetToolTip(rect, tip);

例如,工具提示应该是'< -85°C',但显示的工具提示显示'C°85->;'

1 个答案:

答案 0 :(得分:0)

所以它似乎是因为想要使堆栈面板从右向左流动而不是从左到右的默认值。

我在堆栈面板上设置了flowDirection,它导致包含工具提示的流向基本上没有出来并做了一些疯狂的蠢事,比如翻转每一个字母并反转一些单词而不是其他单词。没有吓到的想法为什么会这样,但如果我在直接位于每个包装面板块内的网格上将流向设置为LeftToRight,则包含的内容将再次按照常规规则开始运行。