Files
GhostEngine/Ghost.Graphics.Test/Controls/DebugConsole.xaml
Misaki 6f786a0698 Refactor namespaces and improve resource handling
- Updated namespaces from `Ghost.UnitTest` to `Ghost.Graphics.Test` across multiple files.
- Refactored `GraphicsTestWindow` to use a new `RenderSystem` configuration.
- Removed deprecated `Logger` and `SerializationTest` classes.
- Improved memory management in D3D12 components, including resource allocation and cleanup.
- Added `[SupportedOSPlatform]` attributes to specify Windows version compatibility.
- Updated `.editorconfig` settings and project references for consistency.
- Enabled `nativeDebugging` in `launchSettings.json`.
2025-11-11 21:30:47 +09:00

121 lines
4.6 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="Ghost.Graphics.Test.Controls.DebugConsole"
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:local="using:Ghost.Graphics.Test.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<UserControl.Resources>
<local:LogLevelToColorConverter x:Key="LogLevelToColorConverter" />
<local:LogLevelToSymbolConverter x:Key="LogLevelToSymbolConverter" />
<DataTemplate x:Key="LogItemTemplate">
<Border Padding="8,4" Background="Transparent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Margin="0,0,8,0"
VerticalAlignment="Center"
FontFamily="Segoe UI Symbol"
Foreground="{Binding Level, Converter={StaticResource LogLevelToColorConverter}}"
Text="{Binding Level, Converter={StaticResource LogLevelToSymbolConverter}}" />
<TextBlock
Grid.Column="1"
Margin="0,0,8,0"
VerticalAlignment="Center"
FontFamily="Consolas"
Foreground="Gray"
Text="{Binding Timestamp}" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Center"
Text="{Binding Message}"
TextWrapping="Wrap" />
</Grid>
</Border>
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Toolbar -->
<Border
Grid.Row="0"
Background="{ThemeResource SystemControlBackgroundAltMediumBrush}"
BorderBrush="{ThemeResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<StackPanel Margin="8,4" Orientation="Horizontal">
<Button
x:Name="ClearButton"
Margin="0,0,8,0"
Click="ClearButton_Click"
Content="Clear" />
<CheckBox
x:Name="AutoScrollCheckBox"
Margin="0,0,8,0"
Content="Auto Scroll"
IsChecked="True" />
<CheckBox
x:Name="ShowStackTraceCheckBox"
Margin="0,0,8,0"
Checked="ShowStackTraceCheckBox_Checked"
Content="Stack Trace"
Unchecked="ShowStackTraceCheckBox_Unchecked" />
<!-- Log level filters -->
<TextBlock
Margin="16,0,8,0"
VerticalAlignment="Center"
Text="Show:" />
<CheckBox
x:Name="ShowInfoCheckBox"
Margin="0,0,4,0"
Content="Info"
IsChecked="True" />
<CheckBox
x:Name="ShowWarningCheckBox"
Margin="0,0,4,0"
Content="Warning"
IsChecked="True" />
<CheckBox
x:Name="ShowErrorCheckBox"
Margin="0,0,4,0"
Content="Error"
IsChecked="True" />
<CheckBox
x:Name="ShowDebugCheckBox"
Margin="0,0,4,0"
Content="Debug"
IsChecked="True" />
</StackPanel>
</Border>
<!-- Log display -->
<ScrollViewer
x:Name="LogScrollViewer"
Grid.Row="1"
HorizontalScrollBarVisibility="Auto"
HorizontalScrollMode="Auto"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto"
ZoomMode="Disabled">
<ItemsRepeater x:Name="LogItemsRepeater" ItemTemplate="{StaticResource LogItemTemplate}" />
</ScrollViewer>
</Grid>
</UserControl>