Beispiel #1
0
        // Tooltip

        /// <summary>
        /// Loads TooltipStyle and adds it to the window
        /// </summary>
        internal static void LoadTooltipStyle()
        {
            GetToolTipMessage = new ToolTipMessage
            {
                Focusable  = false,
                Opacity    = 0,
                Visibility = Visibility.Hidden
            };

            LoadWindows.GetMainWindow.ParentContainer.Children.Add(GetToolTipMessage);

#if DEBUG
            Trace.WriteLine(nameof(GetToolTipMessage) + " loaded ");
#endif
        }
    //提示框的显示方法
    public void Show(ToolTipMessage message)
    {
        string text = message.str;

        this.toolTipText.text = text;
        this.contentText.text = text;
        if (text == "")
        {
            Hide();
            return;
        }
        SetLocalPosition(message.position);

        targetAlpha = 1.0f;
    }
    //提示框的显示方法
    public void Show(ToolTipMessage message)
    {
        string text = message.str;

        this.toolTipText.text = text;
        this.contentText.text = text;
        if (text != null && 0 == text.Length)
        {
            targetAlpha = 0;
            return;
        }
        SetLocalPosition(message.position);

        targetAlpha = 1.0f;

        Hide();
    }