From 48bad22ebae29b8e399e31fc367687e38b6f19db Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 31 Dec 2021 03:43:23 -0500 Subject: [PATCH] Do not hardcode Margin and VerticalAlignment on data grid text column --- src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs | 5 +---- src/Avalonia.Controls.DataGrid/Themes/Default.xaml | 4 ++++ src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs index 1cf6ab68acf..79e6a1d910e 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridTextColumn.cs @@ -18,8 +18,6 @@ namespace Avalonia.Controls /// public class DataGridTextColumn : DataGridBoundColumn { - private const string DATAGRID_TextColumnCellTextBlockMarginKey = "DataGridTextColumnCellTextBlockMargin"; - /// /// Initializes a new instance of the class. /// @@ -162,8 +160,7 @@ protected override IControl GenerateElement(DataGridCell cell, object dataItem) { TextBlock textBlockElement = new TextBlock { - [!Layoutable.MarginProperty] = new DynamicResourceExtension(DATAGRID_TextColumnCellTextBlockMarginKey), - VerticalAlignment = VerticalAlignment.Center + Name = "CellTextBlock" }; SyncProperties(textBlockElement); diff --git a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml b/src/Avalonia.Controls.DataGrid/Themes/Default.xaml index 6715b7ceb97..5e62aa4e4de 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Default.xaml @@ -29,6 +29,10 @@ + + +