public static void ToolTip(Primitive shapeName, Primitive tip)
{
Type GraphicsWindowType = typeof(GraphicsWindow);
Dictionary<string, UIElement> _objectsMap;
UIElement obj;
try
{
_objectsMap = (Dictionary<string, UIElement>)GraphicsWindowType.GetField("_objectsMap", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null);
if (!_objectsMap.TryGetValue(shapeName, out obj))
{
Utilities.OnShapeError(Utilities.GetCurrentMethod(), shapeName);
return;
}
InvokeHelper ret = new InvokeHelper(delegate
{
ToolTip toolTip = new ToolTip();
toolTip.Content = tip;
try
{
((FrameworkElement)obj).ToolTip = toolTip;
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
});
FastThread.Invoke(ret);
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
}