private void TextBlock_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { var textblock = sender as Label; if (textblock == null) { return; } MessageShowInfo.Show(textblock.Content.ToString(), textblock.ToolTip.ToString()); }
/// <summary> /// 静态方法 模拟MESSAGEBOX.Show方法 /// </summary> /// <param name="title">标题</param> /// <param name="msg">消息</param> /// <returns></returns> public static bool?Show(string title, string msg) { var msgBox = new MessageShowInfo(); msgBox.Title = title; msgBox.Message = msg; msgBox.Topmost = true; msgBox.btnYes.Content = "确定"; return(msgBox.ShowDialog()); }