1
0
Fork 0
mirror of https://github.com/oMaN-Rod/nxDumpFuse.git synced 2024-11-09 12:11:45 +00:00

Hack to change error log entry, binding color is not working

This commit is contained in:
Omar 2021-10-22 19:39:14 -04:00
parent f7dec5d29d
commit 170fe100ec
2 changed files with 11 additions and 1 deletions

View file

@ -46,7 +46,8 @@
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
VerticalAlignment="Top" VerticalAlignment="Top"
Height="300"> Height="300"
LoadingRow="FuseSimpleLog_OnLoadingRow">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="Type" Binding="{Binding Type}" Width="Auto" <DataGridTextColumn Header="Type" Binding="{Binding Type}" Width="Auto"
Foreground="{Binding Color}" FontSize="12" /> Foreground="{Binding Color}" FontSize="12" />

View file

@ -1,5 +1,8 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Media;
using nxDumpFuse.Model;
using nxDumpFuse.Model.Enums;
using nxDumpFuse.ViewModels; using nxDumpFuse.ViewModels;
namespace nxDumpFuse.Views namespace nxDumpFuse.Views
@ -15,5 +18,11 @@ namespace nxDumpFuse.Views
{ {
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
} }
private void FuseSimpleLog_OnLoadingRow(object? sender, DataGridRowEventArgs e)
{
if (e.Row.DataContext is FuseSimpleLog { Type: FuseSimpleLogType.Error })
e.Row.Background = Brushes.Red;
}
} }
} }