-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainPage.xaml
78 lines (73 loc) · 3.55 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<Page
x:Class="XmlSyntaxVisualizerUwp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XmlSyntaxVisualizerUwp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:monaco="using:Monaco"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<monaco:CodeEditor x:Name="XmlEditor"
Loading="XmlEditor_Loading"/>
<ScrollViewer Grid.Row="1">
<TextBlock x:Name="CleanedXml"/>
</ScrollViewer>
<muxc:TreeView x:Name="XmlSyntaxTree" Grid.Column="1"
Grid.RowSpan="2"
ItemsSource="{x:Bind RootNodes, Mode=OneWay}"
ItemInvoked="XmlSyntaxTree_ItemInvoked">
<muxc:TreeView.ItemTemplate>
<DataTemplate x:DataType="local:XmlSyntaxData">
<muxc:TreeViewItem ItemsSource="{x:Bind Children}"
IsExpanded="True"
PointerMoved="TreeViewItem_PointerMoved">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="🛑" Foreground="Red"
Margin="0,0,4,0"
Visibility="{x:Bind IsError}"/>
<TextBlock Grid.Column="2">
<Run FontWeight="Bold" Text="{x:Bind Type}"
Foreground="{x:Bind local:MainPage.ColorSelector(TypeClass)}"/>
<Run Text="{x:Bind Text}"/>
<Run>[</Run><Run Text="{x:Bind SpanStart}"/>
<Run>..</Run><Run Text="{x:Bind SpanEnd}"/><Run>)</Run>
</TextBlock>
<TextBlock Text="{x:Bind ErrorText}"
Visibility="{x:Bind IsError}"
Grid.Row="2" Grid.ColumnSpan="2"
Foreground="Red"/>
</Grid>
</muxc:TreeViewItem>
</DataTemplate>
</muxc:TreeView.ItemTemplate>
</muxc:TreeView>
<StackPanel Grid.Row="2" Margin="4,4,0,0">
<TextBlock>
<Run>Cursor Position Line: </Run>
<Run Text="{x:Bind CurrentPosition.LineNumber, Mode=OneWay}"/>
<Run> Col: </Run>
<Run Text="{x:Bind CurrentPosition.Column, Mode=OneWay}"/>
</TextBlock>
<TextBlock Text="{x:Bind ElementInfo, Mode=OneWay}"/>
</StackPanel>
</Grid>
</Page>