-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
133 lines (110 loc) · 6.64 KB
/
MainWindow.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<Window x:Class="ModelPropertyChecker.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ModelPropertyChecker"
xmlns:generic="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="Arma Model Property Checker" Height="450" Width="800"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
</Window.Resources>
<Grid Margin="0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0">
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Content="Load Models" Height="20" Click="ButtonBase_OnClick" Visibility="{Binding Path=directory.IsNotLoading, Converter={StaticResource BoolToVis}}"/>
<Button Grid.Row="0" Grid.Column="1" Content="Export issues" Height="20" Click="Button_ExportIssues_OnClick" Visibility="{Binding Path=directory.IsNotLoading, Converter={StaticResource BoolToVis}}"/>
<ProgressBar Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Height="20" VerticalAlignment="Top"
Visibility="{Binding Path=directory.IsLoading, Converter={StaticResource BoolToVis}}"
Minimum="0"
Maximum="{Binding directory.totalNumberOfModels}"
Value="{Binding directory.models.Count, Mode=OneWay}"
IsIndeterminate="{Binding directory.isIndeterminate}"/>
<TextBlock
Visibility="{Binding Path=directory.IsLoading, Converter={StaticResource BoolToVis}}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Grid.Row="0"
Grid.Column="0" Grid.ColumnSpan="2"
>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}/{1} {2:P2}">
<Binding Path="directory.models.Count" Mode="OneWay"/>
<Binding Path="directory.totalNumberOfModels" Mode="OneWay"/>
<Binding Path="directory.completedPercentage" Mode="OneWay"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TreeView Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" SelectedItemChanged="SelectionChanged"
ItemsSource="{Binding directory.models, PresentationTraceSources.TraceLevel=High}"
Margin="0"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding lods.Values}" DataType="{x:Type local:Model}">
<StackPanel Orientation="Horizontal">
<Label>
<Label.Style>
<Style TargetType="Label">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=hasErrors}" Value="True">
<Setter Property="Content" Value="❌" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=hasWarnings}" Value="True">
<Setter Property="Content" Value="⚠" />
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
<Label Content="{Binding subPath, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
<Label Content="{Binding exceptionCount}" ContentStringFormat="({0})"/>
</StackPanel>
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate DataType="local:LOD">
<StackPanel Orientation="Horizontal">
<Label>
<Label.Style>
<Style TargetType="Label">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=hasErrors}" Value="True">
<Setter Property="Content" Value="❌" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=hasWarnings}" Value="True">
<Setter Property="Content" Value="⚠" />
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
<Label Content="{Binding resolution}"/>
<Label Content="{Binding exceptionCount}" ContentStringFormat="({0})"/>
</StackPanel>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid>
<GridSplitter Grid.Column="1" Width="5" ResizeBehavior="PreviousAndNext" ShowsPreview="True" ResizeDirection="Columns" />
<DockPanel Grid.Column="2">
<local:LodInfo DataContext="{Binding Path=currentLod}"></local:LodInfo>
</DockPanel>
</Grid>
</Window>