由于某些原因,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- >”
发布于 2014-09-08 20:22:52
因此,这似乎是因为希望使堆栈面板从右向左流动,而不是从左到右的默认值。
我在堆栈面板上设置了flowDirection,这使得包含工具提示的流方向基本上被扭曲,并且做了一些疯狂的事情,比如倒转每一个字母,倒转一些单词,而不是其他。不知道为什么会发生这种情况,但是如果我在每个包装面板块内的网格上将流方向设置为LeftToRight,所包含的内容就会再次按照正常规则运行。
https://stackoverflow.com/questions/25730390
复制相似问题