From efafe8613873b311352d374f1f4e0935e36414f9 Mon Sep 17 00:00:00 2001 From: Brian Postlethwaite Date: Wed, 15 Nov 2017 14:43:01 +0100 Subject: [PATCH] tidy up UWP display, and include the tooltip text onto the display as grey italic text --- UWP/MainPage.xaml | 12 +++++++----- UWP/MainPage.xaml.cs | 13 +++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/UWP/MainPage.xaml b/UWP/MainPage.xaml index 7877309..b60e5b5 100644 --- a/UWP/MainPage.xaml +++ b/UWP/MainPage.xaml @@ -25,7 +25,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -76,8 +76,10 @@ - - + + + + - + diff --git a/UWP/MainPage.xaml.cs b/UWP/MainPage.xaml.cs index 20999df..381cce0 100644 --- a/UWP/MainPage.xaml.cs +++ b/UWP/MainPage.xaml.cs @@ -472,8 +472,6 @@ private void AppendResults(string text, bool error = false, string tooltip = nul var run = new Run() { Text = text }; var para = new Paragraph(); para.Inlines.Add(run); - //if (!string.IsNullOrEmpty(tooltip)) - // para.ToolTip = tooltip; para.Margin = new Thickness(2); textboxResult.Blocks.Add(para); if (error) @@ -485,6 +483,17 @@ private void AppendResults(string text, bool error = false, string tooltip = nul { para.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Black); } + if (!string.IsNullOrEmpty(tooltip)) + { + ToolTip tip = new ToolTip(); + tip.Content = tooltip; + ToolTipService.SetToolTip(para, tip); + + var run2 = new Run() { Text = " " + tooltip.Replace("\r\n", ", ") }; + run2.Foreground = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Gray); + run2.FontStyle = Windows.UI.Text.FontStyle.Italic; + para.Inlines.Add(run2); + } } public class ExpressionElementContext