Skip to content

Commit

Permalink
tidy up UWP display, and include the tooltip text onto the display as…
Browse files Browse the repository at this point in the history
… grey italic text
  • Loading branch information
brianpos committed Nov 15, 2017
1 parent 61d963f commit efafe86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
12 changes: 7 additions & 5 deletions UWP/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<controls:HamburgerMenu PaneBackground="Black" Foreground="White" ItemTemplate="{StaticResource HamburDefaultTemplate}" x:Name="hamburgerMenuControl" Margin="0,5,0,-5">
<controls:HamburgerMenu PaneBackground="Black" Foreground="White" ItemTemplate="{StaticResource HamburDefaultTemplate}" x:Name="hamburgerMenuControl" Margin="0,0,0,0">
<Frame x:Name="contentFrame" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
Expand All @@ -44,7 +44,7 @@
<RowDefinition></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
</Grid.RowDefinitions>
<TextBox x:Name="textboxExpression" AcceptsReturn="True" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" />
<TextBox x:Name="textboxExpression" AcceptsReturn="True" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" />
<StackPanel Grid.Row="1" Orientation="Horizontal" Background="DarkGray">
<Button Padding="8" Click="ButtonGo_Click">Extract</Button>
<Button Padding="8" Click="ButtonPredicate_Click">Validate</Button>
Expand Down Expand Up @@ -76,8 +76,10 @@
</Grid>
</controls:GridSplitter.Element>
</controls:GridSplitter>
<RichTextBlock x:Name="textboxResult" Grid.Column="0" Grid.Row="2" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" />
<TextBox x:Name="textboxInputXML" Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" AcceptsReturn="True" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" Drop="textboxInputXML_Drop" DragOver="textboxInputXML_DragOver" />
<ScrollViewer Grid.Column="0" Grid.Row="2" >
<RichTextBlock x:Name="textboxResult" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" ScrollViewer.VerticalScrollBarVisibility="Auto" />
</ScrollViewer>
<TextBox x:Name="textboxInputXML" Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" AcceptsReturn="True" FontSize="{Binding TextControlFontSize, Mode=TwoWay}" Drop="textboxInputXML_Drop" DragOver="textboxInputXML_DragOver" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" />
<!--Row Grid Splitter-->
<controls:GridSplitter
Foreground="White"
Expand All @@ -102,7 +104,7 @@
</Grid>
</Frame>
</controls:HamburgerMenu>
<Grid Grid.Row="1" Margin="2" Padding="12,0" Background="DarkGray" >
<Grid Grid.Row="1" Margin="0" Padding="12,0" Background="DarkGray" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
Expand Down
13 changes: 11 additions & 2 deletions UWP/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit efafe86

Please sign in to comment.