forked from stride3d/stride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generic.xaml
109 lines (107 loc) · 8.64 KB
/
generic.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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Stride.Core.Assets.Editor.View.Controls"
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
xmlns:view="clr-namespace:Stride.Core.Assets.Editor.View"
xmlns:diagnostics="clr-namespace:Stride.Core.Assets.Diagnostics;assembly=Stride.Core.Assets">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Stride.Core.Presentation;component/Themes/ThemeSelector.xaml" />
<ResourceDictionary Source="/Stride.Core.Assets.Editor;component/View/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="controls:GridLogViewer">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:GridLogViewer">
<DockPanel x:Name="PART_GridLogViewerCollectionSourceContainer">
<ToolBarTray DockPanel.Dock="Top" Visibility="{Binding IsToolBarVisible, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={sd:VisibleOrCollapsed}}">
<ToolBar ToolBarTray.IsLocked="True" Header="Filters:" Visibility="{Binding CanFilterLog, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={sd:VisibleOrCollapsed}}">
<ToggleButton IsChecked="{Binding ShowDebugMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryDebugMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowVerboseMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryVerboseMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowInfoMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryInfoMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowWarningMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryWarningMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowErrorMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryErrorMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowFatalMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Path Width="12" Height="12" Stretch="Uniform" Fill="{StaticResource TextBrush}" Data="{StaticResource GeometryFatalMessage}" />
</ToggleButton>
<ToggleButton IsChecked="{Binding ShowStacktrace, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Label Content="..." Width="12" Height="12" HorizontalContentAlignment="Center" />
</ToggleButton>
</ToolBar>
</ToolBarTray>
<view:DataGridEx x:Name="PART_LogGridView" ItemsSource="{Binding FilteredLogMessages, RelativeSource={RelativeSource Mode=TemplatedParent}}"
AutoGenerateColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
RowHeaderWidth="0"
IsReadOnly="True"
CanUserAddRows="False"
CanUserDeleteRows="False">
<DataGrid.Resources>
<DataTemplate x:Key="LogMessageTypeCellTemplate" DataType="diagnostics:AssetSerializableLogMessage">
<Path x:Name="MessageTypePath" Width="12" Height="12" Stretch="Uniform" Fill="{DynamicResource TextBrush}">
<Path.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Debug">
<Setter Property="Path.Data" Value="{DynamicResource GeometryDebugMessage}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Verbose">
<Setter Property="Path.Data" Value="{DynamicResource GeometryVerboseMessage}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Info">
<Setter Property="Path.Data" Value="{DynamicResource GeometryInfoMessage}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Warning">
<Setter Property="Path.Data" Value="{DynamicResource GeometryWarningMessage}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Error">
<Setter Property="Path.Data" Value="{DynamicResource GeometryErrorMessage}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.Type, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}, Mode=OneWay}" Value="Fatal">
<Setter Property="Path.Data" Value="{DynamicResource GeometryFatalMessage}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</DataTemplate>
<DataTemplate x:Key="LogMessageHasExceptionCellTemplate" DataType="compilerApp:AssetSerializableLogMessage">
<Border>
<Image SnapsToDevicePixels="True" Width="16" Height="16" Stretch="None" VerticalAlignment="Center" Source="../Resources/exception.png" Visibility="{Binding ExceptionInfo, Mode=OneTime, Converter={sd:Chained {sd:ObjectToBool}, {sd:VisibleOrHidden}}}">
<ToolTipService.ToolTip>
<TextBlock Text="{Binding ExceptionInfo.TypeFullName, Mode=OneTime}" Foreground="#FF2B91AF" FontWeight="Bold"/>
</ToolTipService.ToolTip>
</Image>
</Border>
</DataTemplate>
<DataTemplate x:Key="LogMessageAssetUrlCellTemplate">
<TextBlock Text="{sd:PriorityBinding {Binding DataContext.AssetUrl, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}}, {Binding DataContext.AssetReference.Location, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}}}" />
</DataTemplate>
<DataTemplate x:Key="LogMessageTextCellTemplate" DataType="compilerApp:AssetSerializableLogMessage">
<TextBlock Text="{Binding}" TextWrapping="Wrap" />
</DataTemplate>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTemplateColumn Header="" MinWidth="16" MaxWidth="16" CellTemplate="{StaticResource LogMessageTypeCellTemplate}" >
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="" MinWidth="16" MaxWidth="16" CellTemplate="{StaticResource LogMessageHasExceptionCellTemplate}" />
<DataGridTemplateColumn Header="Message" Width="*" CellTemplate="{StaticResource LogMessageTextCellTemplate}" />
<DataGridTemplateColumn Header="Asset" Width="200" CellTemplate="{StaticResource LogMessageAssetUrlCellTemplate}" />
</DataGrid.Columns>
</view:DataGridEx>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>